|
|
package com.adobe.sample.components;/*** This Java Quick Start deploys a component using the Java API* and uses the following JAR files:* 1. adobe-livecycle-client.jar* 2. adobe-usermanager-client.jar* 3. adobe-workflow-client-sdk.jar* 4. adobe-utilities.jar* 5. jbossall-client.jar (use a different JAR file if LiveCycle ES is not deployed on Jboss)*/import java.util.*;import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;import com.adobe.idp.dsc.registry.component.client.*;import com.adobe.idp.dsc.registry.infomodel.Component;public class RemoveComponent {public static void main(String[] args) {try{//Set connection propertiesProperties ConnectionProps = new Properties();ConnectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");ConnectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");ConnectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");ConnectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");ConnectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");//Create a ServiceClientFactory objectServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);//Create a ComponentRegistryClient objectComponentRegistryClient componentReg = new ComponentRegistryClient(myFactory);//Retrieve the Id of the component to remove from the service containerComponent myComponent = componentReg.getComponent("com.adobe.livecycle.sample.email.emailSampleComponent", "1.0");//Determine if the component is in a running stateif (myComponent.getState()== Component.RUNNING){//Stop the componentComponent stoppedComponent = componentReg.stop(myComponent);//Uninstall the componentcomponentReg.uninstall(stoppedComponent);}elsecomponentReg.uninstall(myComponent);System.out.println("The component was removed.");}catch(Exception e){e.printStackTrace();}}}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/quickStarts_Components.22.6.html