Quick Start (EJB mode): Starting a service using the Java API

The following Java code example starts a service named SendEmailService.

package com.adobe.sample.servicemanager; 
 
/** 
    * This Java Quick Start 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) 
    * 6. jacorb.jar (use a different JAR file if the LiveCycle Server is not deployed on JBoss) 
    * 7. jnp-client.jar (use a different JAR file if the LiveCycle Server is not deployed on JBoss) 
    */ 
import java.util.*; 
import com.adobe.idp.dsc.clientsdk.ServiceClientFactory; 
import com.adobe.idp.dsc.registry.infomodel.ServiceConfiguration; 
import com.adobe.idp.dsc.registry.service.client.ServiceRegistryClient; 
 
public class StartService { 
 
    public static void main(String[] args) { 
         
        try{ 
            //Set connection properties required to invoke LiveCycle ES     
            Properties 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 object 
            ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps); 
 
            //Create a ServiceRegistryClient object 
            ServiceRegistryClient serviceReg = new ServiceRegistryClient(myFactory);  
         
            //Reference the SendEmailService 
            ServiceConfiguration myServiceConfig = serviceReg.getHeadActiveConfiguration("SendEmailService"); 
         
            //Start the SendEmailService 
            serviceReg.start(myServiceConfig); 
            } 
             
                catch(Exception e) 
                { 
                    e.printStackTrace(); 
                } 
    } 
}