org.eclipse.emf.emfstore.internal.client.model.impl.api
Class ESServerFactoryImpl

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.impl.api.ESServerFactoryImpl
All Implemented Interfaces:
ESServerFactory, ESFactory

public final class ESServerFactoryImpl
extends Object
implements ESServerFactory

Implementation of a factory for creating ESServer instances.

Author:
wesendon, emueller

Field Summary
static ESServerFactoryImpl INSTANCE
          The factory instance.
 
Method Summary
 ESServer createAndStartLocalServer()
          Creates a server with a local name and launches a server process locally.
 ESServer createServer(String url, int port, String certificate)
          Creates a server without a local name.
 ESServer createServer(String name, String url, int port, String certificate)
          Creates a server with a local name.
 void stopLocalServer()
          Stop the local server if it has been started.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ESServerFactoryImpl INSTANCE
The factory instance.

Method Detail

createServer

public ESServer createServer(String url,
                             int port,
                             String certificate)
Creates a server without a local name. The created server is not automatically added to the workspace, i.e. most users will call ESWorkspace.addServer(ESServer) in order to to avoid DanglingHREFExceptions upon saving.

Specified by:
createServer in interface ESServerFactory
Parameters:
url - the URL of the server
port - the port of the server where EMFStore is listing on
certificate - the certificate alias to be used
Returns:
an ESServer instance representing the remote server
See Also:
ESServerFactory.createServer(java.lang.String, int, java.lang.String)

createServer

public ESServer createServer(String name,
                             String url,
                             int port,
                             String certificate)
Creates a server with a local name. The created server is not automatically added to the workspace, i.e. most users will call ESWorkspace.addServer(ESServer) in order to to avoid DanglingHREFExceptions upon saving.

Specified by:
createServer in interface ESServerFactory
Parameters:
name - the local name of the server
url - the URL of the server
port - the port of the server where EMFStore is listing on
certificate - the certificate alias to be used
Returns:
an ESServer instance representing the remote server
See Also:
ESServerFactory.createServer(java.lang.String, java.lang.String, int, java.lang.String)

createAndStartLocalServer

public ESServer createAndStartLocalServer()
                                   throws ESServerStartFailedException
Creates a server with a local name and launches a server process locally. Blocks until server is fully running. Only one local server can be started at any point in time. Calling this method with a serve already running will not launch another server, but just return a new ESServer. The created server is not automatically added to the workspace, i.e. most users will call ESWorkspace.addServer(ESServer) in order to to avoid DanglingHREFExceptions upon saving.

Specified by:
createAndStartLocalServer in interface ESServerFactory
Returns:
an ESServer instance representing the local server on the client side.
Throws:
ESServerStartFailedException - if starting the server fails
See Also:
ESServerFactory.createAndStartLocalServer()

stopLocalServer

public void stopLocalServer()
Stop the local server if it has been started. Blocks until server has stopped fully.

Specified by:
stopLocalServer in interface ESServerFactory
See Also:
ESServerFactory.stopLocalServer()


Copyright © 2015. All Rights Reserved.