mvn archetype:generate -DgroupId=com.example -DartifactId=amdatu-demo -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
<dependencies>
<dependency>
<groupId>org.amdatu.remote</groupId>
<artifactId>org.amdatu.remote.discovery.zookeeper</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.amdatu.remote</groupId>
<artifactId>org.amdatu.remote.zookeeper.api</artifactId>
<version>2.4.1</version>
</dependency>
</dependencies>
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
public class DemoService implements BundleActivator {
private ServiceRegistration<?> registration;
@Override
public void start(BundleContext context) throws Exception {
System.out.println("Starting DemoService...");
System.out.println("DemoService started successfully!");
}
@Override
public void stop(BundleContext context) throws Exception {
System.out.println("Stopping DemoService...");
System.out.println("DemoService stopped successfully!");
}
}
properties
zookeeper.hosts=localhost:2181
mvn clean install
java -jar target/amdatu-demo-1.0-SNAPSHOT.jar