Search this API

y.view
Class NodePort.Factory

java.lang.Object
  extended by y.view.NodePort.Factory
Enclosing class:
NodePort

public static final class NodePort.Factory
extends java.lang.Object

This class is used to manage the different configurations for NodePort instances. An instance of this class can be obtained using the static method NodePort.getFactory().

 

Method Summary
 void addConfiguration(java.lang.String id, java.util.Map implementations)
          Registers a new configuration created from the given implementations for the specified id.
 void configure(NodePort port, java.lang.String id)
          Configures the specified port instance using the configuration that has been registered for the given id.
 java.util.Map createDefaultConfigurationMap()
          Returns a map holding the default configuration for NodePort instances.
 java.util.Set getAvailableConfigurations()
          Returns a read-only view of the configuration names added to this factory instance.
 java.lang.Object getImplementation(java.lang.String id, java.lang.Class interfaze)
          Returns the implementation of the specified interface class in the configuration with the given id.
 void removeConfiguration(java.lang.String id)
          Removes the configuration that is registered for the specified id from this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDefaultConfigurationMap

public java.util.Map createDefaultConfigurationMap()
Returns a map holding the default configuration for NodePort instances.

Returns:
a new Map instance.

addConfiguration

public void addConfiguration(java.lang.String id,
                             java.util.Map implementations)
Registers a new configuration created from the given implementations for the specified id. The implementations map will be queried using the class objects of the various interfaces that are supported by the NodePort class for appropriate interface implementations. Values will be copied by reference from the map.

Parameters:
id - the name of the new configuration.
implementations - the interface implementations for the new configuration.

removeConfiguration

public void removeConfiguration(java.lang.String id)
Removes the configuration that is registered for the specified id from this factory.

Parameters:
id - the name of the configuration to remove.

getAvailableConfigurations

public java.util.Set getAvailableConfigurations()
Returns a read-only view of the configuration names added to this factory instance.

Returns:
a read-only set of available configuration names.

configure

public void configure(NodePort port,
                      java.lang.String id)
Configures the specified port instance using the configuration that has been registered for the given id.

Parameters:
port - the NodePort instance to be configured.
id - the name of the configuration that has to be applied.
Throws:
java.lang.IllegalArgumentException - if no configuration has been registered for the specified id.

getImplementation

public java.lang.Object getImplementation(java.lang.String id,
                                          java.lang.Class interfaze)
Returns the implementation of the specified interface class in the configuration with the given id.

Parameters:
id - the name of the configuration.
interfaze - the interface class of the implementation to return.
Returns:
the implementation of the specified interface class in the configuration with the given id or null if there either is no configuration matching the given id, or the configuration does not use a specialized implementation of the specified interface.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.