Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  • By using the architecture service exposed by an instance providing introspection support.
  • By calling the getInstanceDescription() method on a ComponentInstance object (that you create thanks to a Factory)
Code Block
java
java
1Getting the instance description from the ComponentInstance objectjava
    /**
     * Returns the instance description.
     * @return the instance description of the current instance
     */
    InstanceDescription getInstanceDescription();

...

Once you get the InstanceDescription object, cast it in PrimitiveInstanceDescription (be sure that it is really a primitive instance).
Then, you have access to every primitive instance aspects:
service dependencies
provided services
configuration properties
get created implementation objects

Code Block
java
java
titlePrimitive Instance Description methodsjava
    /**
     * Gets the list of object created by the described instance.
     * @return the created objects.
     */
    public String[] getCreatedObjects() {
        ...
    }
    
    /**
     * Gets the instance service dependencies.
     * @return the set of dependency description or an empty array if
     * no dependencies.
     */
    public DependencyDescription[] getDependencies() {
        ...
    }
    
    /**
     * Gets the instance service dependency matching with the given service specification or id.
     * @param specification the service specification of the looked specification.
     * @return the dependency description matching with the given service specification or id.
     * <code>null</code> is not found.
     * no dependencies.
     */
    public DependencyDescription getDependency(String specification) {
        ...
    }
    
    /**
     * Gets the instance provided service matching with the given service specification.
     * @param specification the provided specification of the looked provided service.
     * @return the provided service description matching with the given service specification.
     * <code>null</code> is not found.
     */
    public ProvidedServiceDescription getProvidedService(String specification) {
        ...
    }
    
    /**
     * Gets the instance provided service.
     * @return the set of provided service description or an empty array if
     * no provided services.
     */
    public ProvidedServiceDescription[] getProvidedServices() {
        ...
    }
    
    /**
     * Gets the instance properties.
     * @return the set of property descriptions or an empty array if
     * no properties.
     */
    public PropertyDescription[] getProperties() {
        ...
    }

...