de.cau.cs.kieler.kwebs.client
Class LayoutServiceClients

java.lang.Object
  extended by de.cau.cs.kieler.kwebs.client.LayoutServiceClients

public final class LayoutServiceClients
extends Object

This class handles the registration of layout service clients and the mapping to their supported protocols. Each layout service client has to register itself through the extension registry using the extension point de.cau.cs.kieler.kwebs.client.protocol.support.

Rating proposed yellow
(2011-08-02) reviewed by ckru, mri, msp

Method Summary
 int countClients()
          Returns the number of protool dependent client implementations available for doing service based layout.
 ILayoutServiceClient createClientForServerConfig(ServerConfigData serverConfig)
          Returns a newly instantiated client for a specific protocol or null if no client is available for the specific protocol.
 ILayoutServiceClient getClientForServerConfig(ServerConfigData serverConfig)
          Returns a client for a specific protocol from the pool or null if no client is available for the specific protocol.
static LayoutServiceClients getInstance()
          Get the singleton instance.
 boolean isServerConfigSupported(ServerConfigData serverConfig)
          Returns whether a client for a particular protocol of a server configuration can be supplied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LayoutServiceClients getInstance()
Get the singleton instance.

Returns:
the singleton instance

countClients

public int countClients()
Returns the number of protool dependent client implementations available for doing service based layout.

Returns:
the number of protool dependent client implementations available for doing service based layout.

getClientForServerConfig

public ILayoutServiceClient getClientForServerConfig(ServerConfigData serverConfig)
Returns a client for a specific protocol from the pool or null if no client is available for the specific protocol.

Parameters:
serverConfig - the server configuration to whichs protocol a compatible client is to be retrieved
Returns:
the client compatible with the given protocol or null

createClientForServerConfig

public ILayoutServiceClient createClientForServerConfig(ServerConfigData serverConfig)
Returns a newly instantiated client for a specific protocol or null if no client is available for the specific protocol.

Parameters:
serverConfig - the server configuration to whose protocol a compatible client is to be created
Returns:
the client compatible with the given protocol or null

isServerConfigSupported

public boolean isServerConfigSupported(ServerConfigData serverConfig)
Returns whether a client for a particular protocol of a server configuration can be supplied.

Parameters:
serverConfig - the server configuration
Returns:
whether a client for a particular protocol of a server configuration can be supplied