本文整理汇总了Java中com.sun.corba.se.pept.transport.Selector类的典型用法代码示例。如果您正苦于以下问题:Java Selector类的具体用法?Java Selector怎么用?Java Selector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Selector类属于com.sun.corba.se.pept.transport包,在下文中一共展示了Selector类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: closeConnectionResources
import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void closeConnectionResources() {
if (orb.transportDebugFlag) {
dprint(".closeConnectionResources->: " + this);
}
Selector selector = orb.getTransportManager().getSelector(0);
selector.unregisterForEvent(this);
try {
if (socketChannel != null)
socketChannel.close() ;
if (socket != null && !socket.isClosed())
socket.close() ;
} catch (IOException e) {
if (orb.transportDebugFlag) {
dprint( ".closeConnectionResources: " + this, e ) ;
}
}
if (orb.transportDebugFlag) {
dprint(".closeConnectionResources<-: " + this);
}
}
示例2: close
import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void close ()
{
try {
if (orb.transportDebugFlag) {
dprint(".close->:");
}
Selector selector = orb.getTransportManager().getSelector(0);
selector.unregisterForEvent(this);
if (serverSocketChannel != null) {
serverSocketChannel.close();
}
if (serverSocket != null) {
serverSocket.close();
}
} catch (IOException e) {
if (orb.transportDebugFlag) {
dprint(".close:", e);
}
} finally {
if (orb.transportDebugFlag) {
dprint(".close<-:");
}
}
}
示例3: closeConnectionResources
import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void closeConnectionResources() {
if (orb.transportDebugFlag) {
dprint(".closeConnectionResources->: " + this);
}
Selector selector = orb.getTransportManager().getSelector(0);
if (selector != null) {
selector.unregisterForEvent(this);
}
try {
if (socketChannel != null)
socketChannel.close() ;
if (socket != null && !socket.isClosed())
socket.close() ;
} catch (IOException e) {
if (orb.transportDebugFlag) {
dprint( ".closeConnectionResources: " + this, e ) ;
}
}
if (orb.transportDebugFlag) {
dprint(".closeConnectionResources<-: " + this);
}
}
示例4: close
import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void close ()
{
try {
if (orb.transportDebugFlag) {
dprint(".close->:");
}
Selector selector = orb.getTransportManager().getSelector(0);
if (selector != null) {
selector.unregisterForEvent(this);
}
if (serverSocketChannel != null) {
serverSocketChannel.close();
}
if (serverSocket != null) {
serverSocket.close();
}
} catch (IOException e) {
if (orb.transportDebugFlag) {
dprint(".close:", e);
}
} finally {
if (orb.transportDebugFlag) {
dprint(".close<-:");
}
}
}
示例5: ReaderThreadImpl
import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public ReaderThreadImpl(ORB orb,
Connection connection, Selector selector)
{
this.orb = orb;
this.connection = connection;
this.selector = selector;
keepRunning = true;
}
示例6: ListenerThreadImpl
import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public ListenerThreadImpl(ORB orb, Acceptor acceptor, Selector selector)
{
this.orb = orb;
this.acceptor = acceptor;
this.selector = selector;
keepRunning = true;
}