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

org.distributeme.test.lifecycle.ShutdownService Maven / Gradle / Ivy

package org.distributeme.test.lifecycle;

import org.distributeme.core.ServiceDescriptor;
import org.distributeme.support.lifecycle.LifecycleSupportService;
import org.distributeme.support.lifecycle.generated.LifecycleSupportServiceConstants;
import org.distributeme.support.lifecycle.generated.RemoteLifecycleSupportServiceStub;

public class ShutdownService {
	public static void main(String[] args) {
		if (args.length==0){
			System.out.println("Use ./start.sh "+ShutdownAll.class.getName()+" ");
			System.out.println("for example ./start.sh "+ShutdownAll.class.getName()+" rmi://org_distributeme_test_echo_EchoService.aacpkpybrd@192.168.200.101:9250");
			System.exit(1);
		}
		
		ServiceDescriptor sd = ServiceDescriptor.fromSystemWideUniqueId(args[0]);
		System.out.println("Parsed ServiceDescriptor: "+sd);
		ServiceDescriptor target = sd.changeServiceId(LifecycleSupportServiceConstants.getServiceId());
		LifecycleSupportService service = new RemoteLifecycleSupportServiceStub(target);
		service.shutdown("Killed by "+ShutdownService.class);
		
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy