Search in sources :

Example 1 with TCPServerSOContainer

use of org.eclipse.ecf.provider.generic.TCPServerSOContainer in project ecf by eclipse.

the class ServerStartup method createServers.

protected synchronized void createServers(InputStream ins) throws Exception {
    final ServerConfigParser scp = new ServerConfigParser();
    final List connectors = scp.load(ins);
    if (connectors != null) {
        serverGroups = new TCPServerSOContainerGroup[connectors.size()];
        int j = 0;
        for (final Iterator i = connectors.iterator(); i.hasNext(); ) {
            final Connector connect = (Connector) i.next();
            serverGroups[j] = createServerGroup(connect.getHostname(), connect.getPort());
            final List groups = connect.getGroups();
            for (final Iterator g = groups.iterator(); g.hasNext(); ) {
                final NamedGroup group = (NamedGroup) g.next();
                final TCPServerSOContainer cont = createServerContainer(group.getIDForGroup(), serverGroups[j], group.getName(), connect.getTimeout());
                servers.add(cont);
                // $NON-NLS-1$
                ClientPlugin.log("ECF group server created: " + cont.getConfig().getID().getName());
            }
            serverGroups[j].putOnTheAir();
            j++;
        }
    }
}
Also used : NamedGroup(org.eclipse.ecf.server.generic.app.NamedGroup) Connector(org.eclipse.ecf.server.generic.app.Connector) Iterator(java.util.Iterator) TCPServerSOContainer(org.eclipse.ecf.provider.generic.TCPServerSOContainer) ArrayList(java.util.ArrayList) List(java.util.List) ServerConfigParser(org.eclipse.ecf.server.generic.app.ServerConfigParser)

Example 2 with TCPServerSOContainer

use of org.eclipse.ecf.provider.generic.TCPServerSOContainer in project ecf by eclipse.

the class ServerStartup method createServerContainer.

protected TCPServerSOContainer createServerContainer(String id, TCPServerSOContainerGroup group, String path, int keepAlive) throws IDCreateException {
    final ID newServerID = IDFactory.getDefault().createStringID(id);
    final SOContainerConfig config = new SOContainerConfig(newServerID);
    return new TCPServerSOContainer(config, group, path, keepAlive);
}
Also used : TCPServerSOContainer(org.eclipse.ecf.provider.generic.TCPServerSOContainer) ID(org.eclipse.ecf.core.identity.ID) SOContainerConfig(org.eclipse.ecf.provider.generic.SOContainerConfig)

Aggregations

TCPServerSOContainer (org.eclipse.ecf.provider.generic.TCPServerSOContainer)2 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 ID (org.eclipse.ecf.core.identity.ID)1 SOContainerConfig (org.eclipse.ecf.provider.generic.SOContainerConfig)1 Connector (org.eclipse.ecf.server.generic.app.Connector)1 NamedGroup (org.eclipse.ecf.server.generic.app.NamedGroup)1 ServerConfigParser (org.eclipse.ecf.server.generic.app.ServerConfigParser)1