org.mobicents.media.server.impl.resource.zap
Class Selector

java.lang.Object
  extended by org.mobicents.media.server.impl.resource.zap.Selector
All Implemented Interfaces:
org.mobicents.protocols.ss7.mtp.ChannelSelector

public class Selector
extends java.lang.Object
implements org.mobicents.protocols.ss7.mtp.ChannelSelector


Field Summary
static int READ
           
static int WRITE
           
 
Constructor Summary
Selector()
           
 
Method Summary
 int doPoll(int[] fds, int key, int timeout)
          Delegates select call to unix poll function.
 void doRegister(int fd)
          Registers pipe for polling.
 void doUnregister(int fd)
          Unregisters pipe from polling.
 void register(org.mobicents.protocols.ss7.mtp.Mtp1 channel)
          Register channel with this selector.
 java.util.Collection<org.mobicents.protocols.ss7.mtp.Mtp1> select(int key, int timeout)
          Selects channels wich are ready for specified IO operations.
 void unregister(org.mobicents.protocols.ss7.mtp.Mtp1 channel)
          Unregister channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ

public static final int READ
See Also:
Constant Field Values

WRITE

public static final int WRITE
See Also:
Constant Field Values
Constructor Detail

Selector

public Selector()
Method Detail

register

public void register(org.mobicents.protocols.ss7.mtp.Mtp1 channel)
Register channel with this selector.

Specified by:
register in interface org.mobicents.protocols.ss7.mtp.ChannelSelector
Parameters:
channel - the channel to register.

unregister

public void unregister(org.mobicents.protocols.ss7.mtp.Mtp1 channel)
Unregister channel.

Specified by:
unregister in interface org.mobicents.protocols.ss7.mtp.ChannelSelector
Parameters:
channel - the channel to unregister.

select

public java.util.Collection<org.mobicents.protocols.ss7.mtp.Mtp1> select(int key,
                                                                         int timeout)
Selects channels wich are ready for specified IO operations.

Specified by:
select in interface org.mobicents.protocols.ss7.mtp.ChannelSelector
Parameters:
key - selection key
timeout - the time out for select.
Returns:
the list of channel ready for input or output.

doRegister

public void doRegister(int fd)
Registers pipe for polling.

Parameters:
fd - the file descriptor.

doUnregister

public void doUnregister(int fd)
Unregisters pipe from polling.

Parameters:
fd - the file descriptor.

doPoll

public int doPoll(int[] fds,
                  int key,
                  int timeout)
Delegates select call to unix poll function.

Parameters:
fds - the list of file descriptors.
key - selection key.
Returns:
the number of selected channels.


Copyright © 2010. All Rights Reserved.