Search in sources :

Example 1 with Connector

use of org.eclipse.ecf.server.generic.app.Connector 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)

Aggregations

ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 TCPServerSOContainer (org.eclipse.ecf.provider.generic.TCPServerSOContainer)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