Tabnine Logo
DefaultIoFilterChainBuilder
Code IndexAdd Tabnine to your IDE (free)

How to use
DefaultIoFilterChainBuilder
in
org.littleshoot.mina.common

Best Java code snippets using org.littleshoot.mina.common.DefaultIoFilterChainBuilder (Showing top 13 results out of 315)

origin: org.littleshoot/mina-port

public Object clone() {
  DefaultIoFilterChainBuilder ret = new DefaultIoFilterChainBuilder();
  for (Entry e : entries) {
    ret.addLast(e.getName(), e.getFilter());
  }
  return ret;
}
origin: org.littleshoot/mina-port

/**
 * Attach this filter to the specified builder. It will search for the
 * {@link ExecutorFilter}, and attach itself before and after that filter.
 *
 * @param builder {@link DefaultIoFilterChainBuilder} to attach self to.
 */
public void attach(DefaultIoFilterChainBuilder builder) {
  String name = getThreadPoolFilterEntryName(builder.getAll());
  builder.addBefore(name, getClass().getName() + ".add", new Add());
  builder
      .addAfter(name, getClass().getName() + ".release",
          new Release());
}
origin: org.littleshoot/mina-port

/**
 * @see IoFilterChain#addAfter(String, String, IoFilter)
 */
public synchronized void addAfter(String baseName, String name,
    IoFilter filter) {
  checkBaseName(baseName);
  for (ListIterator<Entry> i = entries.listIterator(); i.hasNext();) {
    Entry base = i.next();
    if (base.getName().equals(baseName)) {
      register(i.nextIndex(), new EntryImpl(name, filter));
      break;
    }
  }
}
origin: org.littleshoot/stun-client

connector.getFilterChain().addLast("stunFilter", stunFilter);
origin: org.littleshoot/mina-port

public void setFilterChainBuilder(IoFilterChainBuilder builder) {
  if (builder == null) {
    builder = new DefaultIoFilterChainBuilder();
  }
  filterChainBuilder = builder;
}
origin: org.littleshoot/stun-server

@Override
protected void bind(final InetSocketAddress bindAddress) {
  this.bindAddress = bindAddress;
  acceptor.addListener(this);
  final DatagramAcceptorConfig config = acceptor.getDefaultConfig();
  config.setThreadModel(ThreadModel.MANUAL);
  config.getSessionConfig().setReuseAddress(true);
  final ProtocolCodecFilter codecFilter = new ProtocolCodecFilter(
      this.codecFactory);
  config.getFilterChain().addLast("stunFilter", codecFilter);
  config.getFilterChain().addLast("executor",
      new ExecutorFilter(threadPool));
  try {
    acceptor.bind(bindAddress, this.ioHandler, config);
    log.debug("Started STUN server!!");
  } catch (final IOException e) {
    log.error("Could not bind server", e);
  }
}
origin: org.littleshoot/mina-port

public void setFilterChainBuilder(IoFilterChainBuilder builder) {
  if (builder == null) {
    builder = new DefaultIoFilterChainBuilder();
  }
  filterChainBuilder = builder;
}
origin: org.littleshoot/littleshoot-ice

.addLast("demuxFilter", demuxingFilter);
origin: org.littleshoot/mina-port

/**
 * @see IoFilterChain#addBefore(String, String, IoFilter)
 */
public synchronized void addBefore(String baseName, String name,
    IoFilter filter) {
  checkBaseName(baseName);
  for (ListIterator<Entry> i = entries.listIterator(); i.hasNext();) {
    Entry base = i.next();
    if (base.getName().equals(baseName)) {
      register(i.previousIndex(), new EntryImpl(name, filter));
      break;
    }
  }
}
origin: org.littleshoot/mina-util

final ProtocolCodecFilter codecFilter = 
  new ProtocolCodecFilter(codecFactory);
filterChainBuilder.addLast("codec", codecFilter);
filterChainBuilder.addLast("threadPool", new ExecutorFilter(executor));
m_log.debug("Started MINA TCP server.");
origin: org.littleshoot/littleshoot-ice

  new ProtocolCodecFilter(demuxingCodecFactory);
connector.getFilterChain().addLast("demuxingFilter", demuxingFilter);
origin: org.littleshoot/sip-client

connector.getFilterChain().addLast(
    "codec",
    new ProtocolCodecFilter(new SipProtocolCodecFactory(
        headerFactory)));
connector.getFilterChain().addLast("threadPool",
    new ExecutorFilter(this.m_acceptingExecutor));
origin: org.littleshoot/turn-client

    m_dataCodecFactory);
m_connector.getFilterChain().addLast("stunFilter", turnFilter);
m_connector.getFilterChain().addLast("dataFilter", dataFilter);
org.littleshoot.mina.commonDefaultIoFilterChainBuilder

Javadoc

The default implementation of IoFilterChainBuilder which is useful in most cases. DefaultIoFilterChainBuilder has an identical interface with IoFilter; it contains a list of IoFilters that you can modify. The IoFilters which are added to this builder will be appended to the IoFilterChain when #buildFilterChain(IoFilterChain) is invoked.

However, the identical interface doesn't mean that it behaves in an exactly same way with IoFilterChain. DefaultIoFilterChainBuilderdoesn't manage the life cycle of the IoFilters at all, and the existing IoSessions won't get affected by the changes in this builder. IoFilterChainBuilders affect only newly created IoSessions.

 
IoAcceptor acceptor = ...; 
DefaultIoFilterChainBuilder builder = acceptor.getFilterChain(); 
builder.addLast( "myFilter", new MyFilter() ); 
... 

Most used methods

  • addLast
  • <init>
    Creates a new instance with an empty filter list.
  • addAfter
  • addBefore
  • checkBaseName
  • clear
  • contains
  • getAll
  • getEntry
  • register

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Table (org.hibernate.mapping)
    A relational table
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now