1.1.1

Table Of Contents
Chapter 17
Starting SQLFire Servers with the
FabricServer Interface
The FabricServer interface provides an easy way to start an embedded SQLFire server process in an existing Java
application.
You generally use the FabricServer interface when you want to provide thin client connectivity to the embedded
SQLFire member. The FabricServer interface enables you to start multiple network services to listen for clients on
different address and port combinations. Using the FabricServer interface also enables you to initialize resources in
the SQLFire server member before you start network services and make the member available to client connections.
Note: Although the FabricServer interface supports starting an embedded locator service, production systems
should always use standalone locators. See Start and Stop Locators on page 223.
Procedure
To start a SQLFire server using the FabricServer interface:
1.
Use the FabricServiceManager factory class to obtain the singleton instance of FabricServer. For example:
FabricServer server = FabricServiceManager.getFabricServerInstance();
2. Create a Java Properties object and add all of the boot property denitions that you want to congure when starting
the server. For example:
Properties bootProps = new Properties();
bootProps.setProperty("mcast-port", "12444");
As an alternative, you can dene properties as system properties (pass with the -D option to the JVM), congure
them in a properties le, or rely on default property values. Conguration Properties on page 319 provides more
information.
3. Use the FabricServer.start() method with start the server using your Properties object:
server.start(p);
Note: SQLFire supports only a single FabricServer instance in a JVM at any given time. If you invoke start()
multiple times using the same Properties, then no action is taken during subsequent calls. If you invoke start()
multiple times using different properties, then by default the existing FabricServer instance is rst stopped
and then restarted with the new properties. You can optionally use the start(Properties
bootProperties, boolean ignoreIfStarted) method with a "true" boolean value to reuse a
previous instance instead of restarting it. See the FabricServer JavaDoc for more information.
4. To support client connections, start a network service on a unique client and port combination using the
startNetworkServer() method. You can specify the host and port number as arguments to the method. You can
113