Package org.apache.geronimo.jee.deployment

Examples of org.apache.geronimo.jee.deployment.Gbean


        outboundResourceadapter.getConnectionDefinition().add(connectionDefinition);
        resourceadapter.setOutboundResourceadapter(outboundResourceadapter);
        connector.getResourceadapter().add(resourceadapter);

        // set the Service
        Gbean gbean = deploymentFactory.createGbean();
        gbean.setClazz("gbean-class");
        gbean.setName("gbean-name");
        connector.getService().add(deploymentFactory.createGbean(gbean));

        JAXBElement<Connector> jaxbElement = connectorFactory.createConnector(connector);
       
        //
View Full Code Here


        connectionDefinitionInstance.getConfigPropertySetting().add(configPropertySetting);
        connectionDefinition.getConnectiondefinitionInstance().add(connectionDefinitionInstance);
        outboundResourceadapter.getConnectionDefinition().add(connectionDefinition);
        resourceadapter.setOutboundResourceadapter(outboundResourceadapter);
        connector.getResourceadapter().add(resourceadapter);
        Gbean gbean = deploymentFactory.createGbean();
        gbean.setClazz("resource-connector-gbean-class");
        gbean.setName("resource-connector-gbean-name");
        connector.getService().add(deploymentFactory.createGbean(gbean));
        resource.setConnector(connector);
        org.apache.geronimo.jee.deployment.Pattern deploymentPattern = deploymentFactory.createPattern();
        deploymentPattern.setArtifactId("resource-externalrar-artifactid");
        deploymentPattern.setGroupId("resource-externalrar-groupid");
        deploymentPattern.setModule("resource-externalrar-module");
        deploymentPattern.setVersion("resource-externalrar-version");
        deploymentPattern.setCustomFoo("resource-externalrar-customfoo");
        deploymentPattern.setType("resource-externalrar-type");
        resource.setExternalRar(deploymentPattern);
        applicationClient.getResource().add(resource);

        // set the resource env ref
        ResourceEnvRef resourceEnvRef = namingFactory.createResourceEnvRef();
        resourceEnvRef.setAdminObjectLink("resourceenvref-adminobjectlink");
        resourceEnvRef.setAdminObjectModule("resourceenvref-adminobjectmodule");
        resourceEnvRef.setMessageDestinationLink("resourceenvref-messagedestinationlink");
        resourceEnvRef.setRefName("resourceenvref-refname");
        namingPattern = namingFactory.createPattern();
        namingPattern.setArtifactId("resourceenvref-pattern-artifactid");
        namingPattern.setGroupId("resourceenvref-pattern-groupid");
        namingPattern.setModule("resourceenvref-pattern-module");
        namingPattern.setName("resourceenvref-pattern-name");
        namingPattern.setVersion("resourceenvref-pattern-version");
        resourceEnvRef.setPattern(namingPattern);
        applicationClient.getResourceEnvRef().add(resourceEnvRef);

        // set the resource ref
        ResourceRef resourceRef = namingFactory.createResourceRef();
        resourceRef.setRefName("resourceref-refname");
        resourceRef.setResourceLink("resourceref-resourcelink");
        resourceRef.setUrl("resourceref-url");
        namingPattern = namingFactory.createPattern();
        namingPattern.setArtifactId("resourceref-pattern-artifactid");
        namingPattern.setGroupId("resourceref-pattern-groupid");
        namingPattern.setModule("resourcref-pattern-module");
        namingPattern.setName("resourceref-pattern-name");
        namingPattern.setVersion("resourceref-pattern-version");
        resourceRef.setPattern(namingPattern);
        applicationClient.getResourceRef().add(resourceRef);

        // set the Server Environment
        environment = deploymentFactory.createEnvironment();
        artifact = deploymentFactory.createArtifact();
        artifact.setGroupId("org.apache.geronimo.testsuite");
        artifact.setArtifactId("agent-ear");
        artifact.setVersion("2.2-SNAPSHOT");
        artifact.setType("ear");
        environment.setModuleId(artifact);
        dependencies = deploymentFactory.createDependencies();
        dependency = deploymentFactory.createDependency();
        dependency.setGroupId("org.apache.geronimo.testsuite");
        dependency.setArtifactId("agent-ds");
        dependency.setVersion("2.2-SNAPSHOT");
        dependency.setType("car");
        dependencies.getDependency().add(dependency);
        environment.setDependencies(dependencies);
        applicationClient.setServerEnvironment(environment);

        // add the service
        gbean = deploymentFactory.createGbean();
        gbean.setClazz("service-gbean-class");
        gbean.setName("service-gbean-name");
        applicationClient.getService().add(deploymentFactory.createGbean(gbean));

        // add the service ref
        ServiceRef serviceRef = namingFactory.createServiceRef();
        serviceRef.setServiceRefName("serviceref-refname");
View Full Code Here

        namingPattern.setVersion("messagedestination-pattern-version");
        messageDestination.setPattern(namingPattern);
        openEjbJar.getMessageDestination().add(messageDestination);

        // set the Service
        Gbean gbean = deploymentFactory.createGbean();
        gbean.setClazz("gbean-class");
        gbean.setName("gbean-name");
        openEjbJar.getService().add(deploymentFactory.createGbean(gbean));

        // set the Security
        Security security = securityFactory.createSecurity();
        security.setDefaultRole ("security-role");
View Full Code Here

        pattern.setVersion("extmodule-externalpath-version");
        extModule.setExternalPath(pattern);
        application.getExtModule().add(extModule);

        // set the Service
        Gbean gbean = deploymentFactory.createGbean();
        gbean.setClazz("gbean-class");
        gbean.setName("gbean-name");
        application.getService().add(deploymentFactory.createGbean(gbean));

        // set the Security
        Security security = securityFactory.createSecurity();
        security.setDefaultRole ("security-role");
View Full Code Here

        addPage(new GBeanWizardPage("Page0"));
    }

    @Override
    public boolean performFinish() {
        Gbean gbean;
        switch (element.getSelectionIndex()) {
        case GBEAN:
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText())) {
                return false;
            }
            gbean = (Gbean)eObject;
            if (gbean == null) {
                gbean = (Gbean)getEFactory().create(Gbean.class);
                JAXBElement plan = section.getPlan();
               
                // add the JAXBElement of a GBean, not the GBean
                ObjectFactory objectFactory = new ObjectFactory();
                JAXBModelUtils.getGbeans(plan).add(objectFactory.createGbean((Gbean)gbean));
            }
            gbean.setName(textList.get(0).getText());
            gbean.setClazz(textList.get(1).getText());
            break;

        case ATTRIBUTE:
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText())) {
                return false;
            }
            Attribute attribute = (Attribute)eObject;
            if (attribute == null) {
                attribute = (Attribute)getEFactory().create(Attribute.class);
                gbean = (Gbean)section.getSelectedObject();
               
                // add the JAXBElement of an Attribute, not the Attribute
                ObjectFactory objectFactory = new ObjectFactory();
                gbean.getAttributeOrXmlAttributeOrReference().add(objectFactory.createGbeanAttribute(attribute));
            }
            attribute.setName(textList.get(0).getText());
            attribute.setType(textList.get(1).getText());
            attribute.setValue(textList.get(2).getText());
            break;

        case DEPENDENCY:
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText())) {
                return false;
            }
            Pattern dependency = (Pattern)eObject;
            if (dependency == null) {
                dependency = (Pattern)getEFactory().create(Pattern.class);
                gbean = (Gbean)section.getSelectedObject();

                // add the JAXBElement of a Dependency, not the Dependency
                ObjectFactory objectFactory = new ObjectFactory();
                gbean.getAttributeOrXmlAttributeOrReference().add(objectFactory.createGbeanDependency(dependency));
            }
            dependency.setGroupId(textList.get(0).getText());
            dependency.setArtifactId(textList.get(1).getText());
            dependency.setVersion(textList.get(2).getText());
            dependency.setModule(textList.get(3).getText());
            dependency.setType(textList.get(4).getText());
            dependency.setCustomFoo(textList.get(5).getText());
            break;

        case REFERENCE:
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText()) ||
                    isEmpty(textList.get(2).getText())) {
                return false;
            }
            Reference reference = (Reference)eObject;
            if (reference == null) {
                reference = (Reference)getEFactory().create(Reference.class);
                gbean = (Gbean)section.getSelectedObject();

                // add the JAXBElement of a Dependency, not the Dependency
                ObjectFactory objectFactory = new ObjectFactory();
                gbean.getAttributeOrXmlAttributeOrReference().add(objectFactory.createGbeanReference(reference));
            }
            reference.setName(textList.get(0).getText());
            reference.setGroupId(textList.get(1).getText());
            reference.setArtifactId(textList.get(2).getText());
            reference.setVersion(textList.get(3).getText());
View Full Code Here

  JAXBElement element = (JAXBElement) tree.getSelection()[0].getData();
  Object object = element.getValue();
  if (Gbean.class.isInstance(object)) {
      objectContainer.remove(anItem);
  } else {
      Gbean gbean = (Gbean) ((JAXBElement) tree.getSelection()[0]
        .getParentItem().getData()).getValue();
      gbean.getAttributeOrXmlAttributeOrReference().remove(element);
  }
    }
View Full Code Here

        return ((List) parentElement).toArray();
    }
    if (JAXBElement.class.isInstance(parentElement)) {
        Object object = ((JAXBElement) parentElement).getValue();
        if (Gbean.class.isInstance(object)) {
      Gbean gbean = (Gbean) object;
      return gbean.getAttributeOrXmlAttributeOrReference()
        .toArray();
        }
    }
    return new String[] {};
      }
View Full Code Here

      @Override
      public String getText(Object element) {
    if (JAXBElement.class.isInstance(element)) {
        Object object = ((JAXBElement) element).getValue();
        if (Gbean.class.isInstance(object)) {
      Gbean gbean = (Gbean) object;
      return "GBean: name = \"" + gbean.getName()
        + "\", class = \"" + gbean.getClazz() + "\"";
        } else if (Attribute.class.isInstance(object)) {
      Attribute attribute = (Attribute) object;
      return "Attribute: name = \"" + attribute.getName()
        + "\", type = \"" + attribute.getType()
        + "\", value = \"" + attribute.getValue()
View Full Code Here

      public String getColumnText(Object element, int columnIndex) {
    // System.out.println("here");
    if (JAXBElement.class.isInstance(element)) {
        Object value = ((JAXBElement<?>) element).getValue();
        if (Gbean.class.isInstance(value)) {
      Gbean gbean = (Gbean) value;
      switch (columnIndex) {
      case 0:// security realm name
          if (getGbeanAttributeValue(gbean, "realmName") != null) {
        return getGbeanAttributeValue(gbean,
          "realmName");
View Full Code Here

        "Invalid Login Details", status);
      return false;
  }

  // set a gbean according to the input from wizard
  Gbean gbean = null;
  if (eObject != null) {
      gbean = (Gbean) ((JAXBElement) eObject).getValue();
      isedit = true;
  } else {
      gbean = new Gbean();// create a new gbean
      eObject = objectFactory.createGbean(gbean);
  }

  // add the data into gbean
  String realmName = page0.textEntries[0].getText() == null ? ""
    : page0.textEntries[0].getText();
  gbean.setName(realmName);// set the gbean name the same as realm name
  gbean
    .setClazz("org.apache.geronimo.security.realm.GenericSecurityRealm");// TODO
  // message

  List<JAXBElement<?>> elelist = gbean
    .getAttributeOrXmlAttributeOrReference();

  // set the attribute
  JAXBElement<Attribute> attributeElement = getAttributeElement(elelist);
  if (attributeElement == null) {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.jee.deployment.Gbean

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.