All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.remondis.limbus.system.Component Maven / Gradle / Ivy

Go to download

The Limbus System is a small light-weight CDI framework managing the Limbus Core Components. The object graph is represented by an XML configuration file or can be build using the Limbus System API. This module delivers an optional system component that visualizes the object graph and its dependencies after initializing: com.remondis.limbus.system.visualize.LimbusSystemVisualizer This component can be added to the Limbus System. To keep the dependencies of this module transparent and light-weight, the graph renderer is declared as an optional dependency. Add the following dependencies to your project to use the visualisation component: <!-- Graph Stream for Visualization feature This is an optional dependency and only required if using the com.remondis.limbus.system.visualize.LimbusSystemVisualizer --> <dependency> <groupId>org.graphstream</groupId> <artifactId>gs-core</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>org.graphstream</groupId> <artifactId>gs-ui</artifactId> <version>1.3</version> </dependency>

There is a newer version: 3.1.0
Show newest version
package com.remondis.limbus.system;

import com.remondis.limbus.IInitializable;

/**
 * This class holds information of an instatiated component.
 *
 * @author schuettec
 *
 */
public final class Component {
  protected ComponentConfiguration configuration;
  protected IInitializable instance;
  private IInitializable publicReference;

  Component(ComponentConfiguration configuration, IInitializable instance, IInitializable publicReference) {
    super();
    this.configuration = configuration;
    this.instance = instance;
    this.publicReference = publicReference;
  }

  /**
   * @return the configuration
   */
  public ComponentConfiguration getConfiguration() {
    return configuration;
  }

  /**
   * @return Returns the public reference that was specified by the current object factory.
   */
  public IInitializable getPublicReference() {
    return publicReference;
  }

  /**
   * @return the component
   */
  public IInitializable getInstance() {
    return instance;
  }

  @Override
  public int hashCode() {
    return configuration.hashCode();
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Component other = (Component) obj;
    return configuration.equals(other.getConfiguration());
  }

  /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
    return "Component [\nconfiguration=" + configuration + ",\ninstance=" + instance + "\n]";
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy