org.ijsberg.iglu.configuration.module
Class StandardCluster

java.lang.Object
  extended by org.ijsberg.iglu.configuration.module.StandardCluster
All Implemented Interfaces:
InvocationHandler, Cluster, Connector, Facade

public class StandardCluster
extends Object
implements Cluster, Facade, InvocationHandler


Constructor Summary
StandardCluster()
           
 
Method Summary
 void connect(Component externalComponent)
          Connects component as external, anonymous component
 void connect(String componentId, Component component)
          Connects a component as internal component
 void connect(String componentId, Component component, Class<?>... exposedInterfaces)
          Connects a component as internal, exposed component.
 void disconnect(Component component)
          Disconnects component.
 void expose(String internalComponentId, Class<?>... interfaces)
          Updates exposure of interfaces of an internal component.
 Set<String> getExposedComponentIds()
           
 Class<?>[] getExposedInterfaces(String componentId)
           
 Set<Component> getExternalComponents()
           
 Facade getFacade()
           
 Map<String,Component> getInternalComponents()
           
 Object getProxy(String componentId, Class<?> exposedInterface)
           
 Object invoke(Object proxy, Method method, Object[] arguments)
          Invoked through proxy instance for facade.
 boolean isConnected(Component component)
           
 boolean isConnectedExternally(Component component)
           
 boolean isConnectedInternally(Component component)
           
 boolean isExposed(String componentId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardCluster

public StandardCluster()
Method Detail

isConnected

public boolean isConnected(Component component)

isConnectedInternally

public boolean isConnectedInternally(Component component)

isConnectedExternally

public boolean isConnectedExternally(Component component)

isExposed

public boolean isExposed(String componentId)

connect

public void connect(String componentId,
                    Component component)
             throws ConfigurationException
Connects a component as internal component

Specified by:
connect in interface Connector
Parameters:
componentId -
component -
Throws:
ConfigurationException - if the component is already registered

connect

public void connect(String componentId,
                    Component component,
                    Class<?>... exposedInterfaces)
             throws ConfigurationException
Connects a component as internal, exposed component.

Specified by:
connect in interface Cluster
Parameters:
componentId -
component -
exposedInterfaces - interfaces accessible for external components
Throws:
ConfigurationException - if the component is already registered

connect

public void connect(Component externalComponent)
             throws ConfigurationException
Connects component as external, anonymous component

Specified by:
connect in interface Facade
Parameters:
externalComponent -
Throws:
ConfigurationException - if the component is already registered

disconnect

public void disconnect(Component component)
Description copied from interface: Connector
Disconnects component.

Specified by:
disconnect in interface Connector
Specified by:
disconnect in interface Facade
Parameters:
component -

getExposedComponentIds

public Set<String> getExposedComponentIds()
Specified by:
getExposedComponentIds in interface Facade
Returns:

getExposedInterfaces

public Class<?>[] getExposedInterfaces(String componentId)
Specified by:
getExposedInterfaces in interface Facade
Parameters:
componentId -
Returns:

getProxy

public Object getProxy(String componentId,
                       Class<?> exposedInterface)
Specified by:
getProxy in interface Facade
Parameters:
componentId -
exposedInterface -
Returns:

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] arguments)
              throws Throwable
Invoked through proxy instance for facade.

Specified by:
invoke in interface InvocationHandler
Parameters:
proxy -
method -
arguments -
Returns:
Throws:
Throwable

getFacade

public Facade getFacade()
Specified by:
getFacade in interface Cluster
Returns:

getInternalComponents

public Map<String,Component> getInternalComponents()
Specified by:
getInternalComponents in interface Cluster
Returns:

getExternalComponents

public Set<Component> getExternalComponents()
Specified by:
getExternalComponents in interface Cluster
Returns:

expose

public void expose(String internalComponentId,
                   Class<?>... interfaces)
Description copied from interface: Cluster
Updates exposure of interfaces of an internal component.

Specified by:
expose in interface Cluster
Parameters:
internalComponentId -
interfaces -


Copyright © 2011. All Rights Reserved.