Revision: 16027
Author: [email protected]
Date: Thu Dec 23 05:19:44 2010
Log: renamed ShellSelector
http://code.google.com/p/mobicents/source/detail?r=16027
Added:
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ChannelSelector.java
Deleted:
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellSelector.java
Modified:
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellProvider.java
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellSelectableChannel.java
=======================================
--- /dev/null
+++
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ChannelSelector.java
Thu Dec 23 05:19:44 2010
@@ -0,0 +1,54 @@
+package org.mobicents.ss7.management.transceiver;
+
+import java.io.IOException;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.nio.channels.spi.SelectorProvider;
+import java.util.Set;
+
+import javolution.util.FastList;
+
+public class ChannelSelector {
+
+ protected Selector selector;
+
+ private FastList<ShellSelectionKey> list = new
FastList<ShellSelectionKey>();
+
+ protected ChannelSelector(Selector selector) {
+ this.selector = selector;
+ }
+
+ public static ChannelSelector open() throws IOException {
+ return new
ChannelSelector(SelectorProvider.provider().openSelector());
+ }
+
+ public FastList<ShellSelectionKey> selectNow() throws IOException {
+ list.clear();
+ selector.selectNow();
+ Set<SelectionKey> selection = selector.selectedKeys();
+ for (SelectionKey key : selection) {
+ if (key.isAcceptable()) {
+ ShellSelectionKey k = (ShellSelectionKey)
key.attachment();
+ list.add(k);
+ } else if (key.isReadable()) {
+ ShellSelectionKey k = (ShellSelectionKey)
key.attachment();
+ ((ShellChannel) k.channel()).doRead();
+ if (k.isReadable()) {
+ list.add(k);
+ }
+ } else {
+ ShellSelectionKey k = (ShellSelectionKey)
key.attachment();
+ ((ShellChannel) k.channel()).doWrite();
+ if (k.isWritable()) {
+ list.add(k);
+ }
+ }
+ }
+ selection.clear();
+ return list;
+ }
+
+ public void close() throws IOException {
+ selector.close();
+ }
+}
=======================================
---
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellSelector.java
Thu Dec 23 00:13:37 2010
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.mobicents.ss7.management.transceiver;
-
-import java.io.IOException;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.spi.SelectorProvider;
-import java.util.Set;
-
-import javolution.util.FastList;
-
-public class ShellSelector {
-
- protected Selector selector;
-
- private FastList<ShellSelectionKey> list = new
FastList<ShellSelectionKey>();
-
- protected ShellSelector(Selector selector) {
- this.selector = selector;
- }
-
- public static ShellSelector open() throws IOException {
- return new
ShellSelector(SelectorProvider.provider().openSelector());
- }
-
- public FastList<ShellSelectionKey> selectNow() throws IOException {
- list.clear();
- selector.selectNow();
- Set<SelectionKey> selection = selector.selectedKeys();
- for (SelectionKey key : selection) {
- if (key.isAcceptable()) {
- ShellSelectionKey k = (ShellSelectionKey)
key.attachment();
- list.add(k);
- } else if (key.isReadable()) {
- ShellSelectionKey k = (ShellSelectionKey)
key.attachment();
- ((ShellChannel) k.channel()).doRead();
- if (k.isReadable()) {
- list.add(k);
- }
- } else {
- ShellSelectionKey k = (ShellSelectionKey)
key.attachment();
- ((ShellChannel) k.channel()).doWrite();
- if (k.isWritable()) {
- list.add(k);
- }
- }
- }
- selection.clear();
- return list;
- }
-
- public void close() throws IOException {
- selector.close();
- }
-}
=======================================
---
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellProvider.java
Thu Dec 23 02:39:53 2010
+++
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellProvider.java
Thu Dec 23 05:19:44 2010
@@ -18,8 +18,8 @@
return ShellServerChannel.open(this);
}
- public ShellSelector openSelector() throws IOException {
- return ShellSelector.open();
+ public ChannelSelector openSelector() throws IOException {
+ return ChannelSelector.open();
}
public MessageFactory getMessageFactory(){
=======================================
---
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellSelectableChannel.java
Thu Dec 23 02:44:49 2010
+++
/trunk/protocols/ss7/management/shell/src/main/java/org/mobicents/ss7/management/transceiver/ShellSelectableChannel.java
Thu Dec 23 05:19:44 2010
@@ -9,7 +9,7 @@
//underlying network channel
protected SelectableChannel channel;
- public ShellSelectionKey register(ShellSelector selector, int ops)
throws ClosedChannelException {
+ public ShellSelectionKey register(ChannelSelector selector, int ops)
throws ClosedChannelException {
SelectionKey k = channel.register(selector.selector, ops);
ShellSelectionKey key = new ShellSelectionKey(this, k);
k.attach(key);