本文整理汇总了Java中org.apache.catalina.tribes.ChannelInterceptor.getNext方法的典型用法代码示例。如果您正苦于以下问题:Java ChannelInterceptor.getNext方法的具体用法?Java ChannelInterceptor.getNext怎么用?Java ChannelInterceptor.getNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.tribes.ChannelInterceptor
的用法示例。
在下文中一共展示了ChannelInterceptor.getNext方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addInterceptor
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
/**
* Adds an interceptor to the stack for message processing<br>
* Interceptors are ordered in the way they are added.<br>
* <code>channel.addInterceptor(A);</code><br>
* <code>channel.addInterceptor(C);</code><br>
* <code>channel.addInterceptor(B);</code><br>
* Will result in a interceptor stack like this:<br>
* <code>A -> C -> B</code><br>
* The complete stack will look like this:<br>
* <code>Channel -> A -> C -> B -> ChannelCoordinator</code><br>
* @param interceptor ChannelInterceptorBase
*/
@Override
public void addInterceptor(ChannelInterceptor interceptor) {
if ( interceptors == null ) {
interceptors = interceptor;
interceptors.setNext(coordinator);
interceptors.setPrevious(null);
coordinator.setPrevious(interceptors);
} else {
ChannelInterceptor last = interceptors;
while ( last.getNext() != coordinator ) {
last = last.getNext();
}
last.setNext(interceptor);
interceptor.setNext(coordinator);
interceptor.setPrevious(last);
coordinator.setPrevious(interceptor);
}
}
示例2: start
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
@Override
public synchronized void start(int svc) throws ChannelException {
super.start(svc);
running = true;
if ( thread == null && useThread) {
thread = new PingThread();
thread.setDaemon(true);
String channelName = "";
if (getChannel() instanceof GroupChannel && ((GroupChannel)getChannel()).getName() != null) {
channelName = "[" + ((GroupChannel)getChannel()).getName() + "]";
}
thread.setName("TcpPingInterceptor.PingThread" + channelName +"-"+cnt.addAndGet(1));
thread.start();
}
//acquire the interceptors to invoke on send ping events
ChannelInterceptor next = getNext();
while ( next != null ) {
if ( next instanceof TcpFailureDetector )
failureDetector = new WeakReference<TcpFailureDetector>((TcpFailureDetector)next);
if ( next instanceof StaticMembershipInterceptor )
staticMembers = new WeakReference<StaticMembershipInterceptor>((StaticMembershipInterceptor)next);
next = next.getNext();
}
}
示例3: addInterceptor
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
/**
* Adds an interceptor to the stack for message processing<br>
* Interceptors are ordered in the way they are added.<br>
* <code>channel.addInterceptor(A);</code><br>
* <code>channel.addInterceptor(C);</code><br>
* <code>channel.addInterceptor(B);</code><br>
* Will result in a interceptor stack like this:<br>
* <code>A -> C -> B</code><br>
* The complete stack will look like this:<br>
* <code>Channel -> A -> C -> B -> ChannelCoordinator</code><br>
*
* @param interceptor
* ChannelInterceptorBase
*/
@Override
public void addInterceptor(ChannelInterceptor interceptor) {
if (interceptors == null) {
interceptors = interceptor;
interceptors.setNext(coordinator);
interceptors.setPrevious(null);
coordinator.setPrevious(interceptors);
} else {
ChannelInterceptor last = interceptors;
while (last.getNext() != coordinator) {
last = last.getNext();
}
last.setNext(interceptor);
interceptor.setNext(coordinator);
interceptor.setPrevious(last);
coordinator.setPrevious(interceptor);
}
}
示例4: start
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
@Override
public synchronized void start(int svc) throws ChannelException {
super.start(svc);
running = true;
if (thread == null && useThread) {
thread = new PingThread();
thread.setDaemon(true);
String channelName = "";
if (getChannel() instanceof GroupChannel && ((GroupChannel) getChannel()).getName() != null) {
channelName = "[" + ((GroupChannel) getChannel()).getName() + "]";
}
thread.setName("TcpPingInterceptor.PingThread" + channelName + "-" + cnt.addAndGet(1));
thread.start();
}
// acquire the interceptors to invoke on send ping events
ChannelInterceptor next = getNext();
while (next != null) {
if (next instanceof TcpFailureDetector)
failureDetector = new WeakReference<TcpFailureDetector>((TcpFailureDetector) next);
if (next instanceof StaticMembershipInterceptor)
staticMembers = new WeakReference<StaticMembershipInterceptor>((StaticMembershipInterceptor) next);
next = next.getNext();
}
}
示例5: start
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
@Override
public synchronized void start(int svc) throws ChannelException {
super.start(svc);
running = true;
if ( thread == null && useThread) {
thread = new PingThread();
thread.setDaemon(true);
thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1));
thread.start();
}
//acquire the interceptors to invoke on send ping events
ChannelInterceptor next = getNext();
while ( next != null ) {
if ( next instanceof TcpFailureDetector )
failureDetector = new WeakReference<TcpFailureDetector>((TcpFailureDetector)next);
if ( next instanceof StaticMembershipInterceptor )
staticMembers = new WeakReference<StaticMembershipInterceptor>((StaticMembershipInterceptor)next);
next = next.getNext();
}
}
示例6: start
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
@Override
public synchronized void start(int svc) throws ChannelException {
super.start(svc);
running = true;
if ( thread == null ) {
thread = new PingThread();
thread.setDaemon(true);
thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1));
thread.start();
}
//acquire the interceptors to invoke on send ping events
ChannelInterceptor next = getNext();
while ( next != null ) {
if ( next instanceof TcpFailureDetector )
failureDetector = new WeakReference<TcpFailureDetector>((TcpFailureDetector)next);
if ( next instanceof StaticMembershipInterceptor )
staticMembers = new WeakReference<StaticMembershipInterceptor>((StaticMembershipInterceptor)next);
next = next.getNext();
}
}
示例7: checkOptionFlags
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
/**
* Validates the option flags that each interceptor is using and reports
* an error if two interceptor share the same flag.
* @throws ChannelException
*/
protected void checkOptionFlags() throws ChannelException {
StringBuilder conflicts = new StringBuilder();
ChannelInterceptor first = interceptors;
while ( first != null ) {
int flag = first.getOptionFlag();
if ( flag != 0 ) {
ChannelInterceptor next = first.getNext();
while ( next != null ) {
int nflag = next.getOptionFlag();
if (nflag!=0 && (((flag & nflag) == flag ) || ((flag & nflag) == nflag)) ) {
conflicts.append("[");
conflicts.append(first.getClass().getName());
conflicts.append(":");
conflicts.append(flag);
conflicts.append(" == ");
conflicts.append(next.getClass().getName());
conflicts.append(":");
conflicts.append(nflag);
conflicts.append("] ");
}//end if
next = next.getNext();
}//while
}//end if
first = first.getNext();
}//while
if ( conflicts.length() > 0 ) throw new ChannelException("Interceptor option flag conflict: "+conflicts.toString());
}
示例8: checkOptionFlags
import org.apache.catalina.tribes.ChannelInterceptor; //导入方法依赖的package包/类
/**
* Validates the option flags that each interceptor is using and reports an
* error if two interceptor share the same flag.
*
* @throws ChannelException
*/
protected void checkOptionFlags() throws ChannelException {
StringBuilder conflicts = new StringBuilder();
ChannelInterceptor first = interceptors;
while (first != null) {
int flag = first.getOptionFlag();
if (flag != 0) {
ChannelInterceptor next = first.getNext();
while (next != null) {
int nflag = next.getOptionFlag();
if (nflag != 0 && (((flag & nflag) == flag) || ((flag & nflag) == nflag))) {
conflicts.append("[");
conflicts.append(first.getClass().getName());
conflicts.append(":");
conflicts.append(flag);
conflicts.append(" == ");
conflicts.append(next.getClass().getName());
conflicts.append(":");
conflicts.append(nflag);
conflicts.append("] ");
} // end if
next = next.getNext();
} // while
} // end if
first = first.getNext();
} // while
if (conflicts.length() > 0)
throw new ChannelException("Interceptor option flag conflict: " + conflicts.toString());
}