Skip Headers

# Using Java

Previous

Next

Example: Creating a Session Broker illustrates how you can create a session broker in Java code by instantiating a `SessionBroker` and registering the brokered sessions with it.

Because the session broker references other sessions, configure these sessions before instantiating the session broker. Add all required descriptors to the session, but do not initialize the descriptors or log the sessions. The session broker manages these issues when you instantiate it.

Creating a Session Broker

    Project databaseProject = new MyDatabaseProject();
    Server databaseSession = databaseProject.createServerSession();

    Project eisProject = new MyEISProject();
    Server eisSession = eisProject.createServerSession();

    SessionBroker sessionBroker = new SessionBroker();
    sessionBroker.registerSession("myDatabase", databaseSession);
    sessionBroker.registerSession("myEIS", eisSession);

    sessionBroker.login();