Package org.mule.registry

Examples of org.mule.registry.RegistryComponent


        // Check that artifact exists
        if (!artifact.isFile()) {
          throw new JBIException("Artifact file not found: " + sua[i].getTarget().getArtifactsZip());
        }
        // Check that component exists
        RegistryComponent component = getRegistry().getComponent(componentName);
        if (component == null) {
          throw new JBIException("Service assembly requires a missing component: " + componentName);
        }
        // Check component is fully installed
        if (!component.getCurrentState().equals(RUNNING)) {
          throw new JBIException("Component is not started: " + componentName);
        }
        // Check that we can deploy onto it
        ServiceUnitManager mgr = ((Component)component.getComponent()).getServiceUnitManager();
        if (mgr == null) {
          throw new JBIException("Component does not accept deployments: " + componentName);
        }
        // Check for duplicate SU
        Unit[] compUnits = component.getUnits();
        for (int j = 0; j < compUnits.length; j++) {
          if (compUnits[i].getName().equals(suName)) {
            throw new JBIException("Service unit already installed on component: " + suName);
          }
        }
View Full Code Here


    return assembly.undeploy();
  }

  public String[] getDeployedServiceUnitList(String componentName)
      throws Exception {
    RegistryComponent component = this.registry.getComponent(componentName);
    if (component == null) {
      throw new JBIException("Component not installed: " + componentName);
    }
    Unit[] units = component.getUnits();
    String[] names = new String[units.length];
    for (int i = 0; i < units.length; i++) {
      names[i] = units[i].getName();
    }
    return names;
View Full Code Here

    return ((Jbi)assembly.getDescriptor().getConfiguration()).xmlText();
  }

  public String[] getDeployedServiceAssembliesForComponent(
      String componentName) throws Exception {
    RegistryComponent component = this.registry.getComponent(componentName);
    if (component == null) {
      throw new JBIException("Component not installed: " + componentName);
    }
    if (component != null) {
      Unit[] units = component.getUnits();
      Set names = new HashSet();
      for (int i = 0; i < units.length; i++) {
        names.add(units[i].getAssembly().getName());
      }
      return (String[]) names.toArray(new String[names.size()]);
View Full Code Here

    return (String[]) names.toArray(new String[names.size()]);
  }

  public boolean isDeployedServiceUnit(String componentName, String suName)
      throws Exception {
    RegistryComponent comp = this.registry.getComponent(componentName);
    if (comp != null) {
      Unit[] units = comp.getUnits();
      for (int i = 0; i < units.length; i++) {
        if (units[i].getName().equals(suName)) {
          return true;
        }
      }
View Full Code Here

    }
    return false;
  }

  public boolean canDeployToComponent(String componentName) {
    RegistryComponent comp = this.registry.getComponent(componentName);
    if (comp != null) {
      // TODO: check component state
      ServiceUnitManager mgr = ((Component)comp.getComponent()).getServiceUnitManager();
      return mgr != null;
    }
    return false;
  }
View Full Code Here

    public JbiRegistry(RegistryStore store, ManagementContext context) {
        super(store, context);
    }

    public RegistryComponent createComponent(String name, ComponentType type) {
        RegistryComponent component = new JbiRegistryComponent(name, type, this);
        return component;
    }
View Full Code Here

TOP

Related Classes of org.mule.registry.RegistryComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.