IReferenceable

Interface with methods used to set references for components that depend on other components.

Description

The IReferenceable interface allows you to set references for components that depend on other components.

Important points

  • If a component requires explicit notification to unset references, it must also implement the IUnreferenceable interface.

Instance methods

setReferences

Sets references to dependent components.

void setReferences(IReferences references) throws ReferenceException, ConfigException

  • references: IReferences - references to locate the component’s dependencies.

Examples

{
   public class MyController implements IReferenceable {
      public IMyPersistence _persistence;
      ...
      public void setReferences(IReferences references) {
        this._persistence = (IMyPersistence)references.getOneRequired(
          new Descriptor("mygroup", "persistence", "*", "*", "1.0")
        );
      }
      ...
   }
   }

See also