org.idoox.config
Interface Configurable


public interface Configurable

Configurable represents configuration of a particular area in WSO2 SOA Enablement Server. An instance of Configurable for particular fragment of configuration can be obtained by using of Configurator. To access the configuration from the Configurable is necessary to create interface that contains the bean-pattern getters/setters for the data you want to access, and then narrow the Configurable to your interface.

 interface MyConfiguration{
    String getName();
    void setName(String name);
 }

 Configurable configuration = ...;
 MyConfiguration myConf = (MyConfiguration)configuration.narrow(MyConfiguration.class);
 String myName = myConf.getName();
 if (myName == null) myConf.setName("myConfiguration");
 ...

Since:
1.0
Component:
Core

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds property change listener on this configurable.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds vetoable change listener on this configurable.
 java.lang.String getId()
          Deprecated. Use getType() and getName() instead
 java.lang.String getName()
          Returns the for this configurable.
 Configurable getParent()
          Returns the predecessor of this configurable.
 java.lang.String getReferenceLocation()
          Returns the location of the service directory.
 java.lang.String getType()
          Returns the type name for this configurable.
 boolean isPersistent()
          Returns true if the configurable is persistent (changes in the configuration are persistent).
 java.lang.Object narrow(java.lang.Class iface)
          Return an instance of given interface.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes property change listener from this configurable.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes vetoable change listener from this configurable.
 

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds property change listener on this configurable. If property is changed listeners will be notified.

Parameters:
listener - the listener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes property change listener from this configurable.

Parameters:
listener - the listener to be removed

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds vetoable change listener on this configurable. If property is being changed listeners will be notified (before the change is done). Listeners can veto the change.

Parameters:
listener - the listener to be added

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes vetoable change listener from this configurable.

Parameters:
listener - the listener to be removed

getId

public java.lang.String getId()
Deprecated. Use getType() and getName() instead

Returns the id of this configurable.

Returns:
the id of the configurable

getType

public java.lang.String getType()
Returns the type name for this configurable.

Returns:
the type name for this instance

getName

public java.lang.String getName()
Returns the for this configurable.

Returns:
the name for this instance

narrow

public java.lang.Object narrow(java.lang.Class iface)
Return an instance of given interface.

Parameters:
iface - the interface to be narrowed to
Returns:
instance of the iface interface, never null

getParent

public Configurable getParent()
Returns the predecessor of this configurable.

Returns:
parent of the configurable or null if there is no parent

getReferenceLocation

public java.lang.String getReferenceLocation()
Returns the location of the service directory.

Returns:
path to the application if the configuration file configures an application, null otherwise

isPersistent

public boolean isPersistent()
Returns true if the configurable is persistent (changes in the configuration are persistent).

Returns:
true if the configurable is persistent
Since:
4.5