Exemplo n.º 1
0
  public static void main(String[] args) throws Exception {
    Swarm swarm = new Swarm();

    swarm.fraction(
        MessagingFraction.createDefaultFraction()
            .defaultServer(
                (s) -> {
                  s.enableClustering();
                  s.jmsTopic("my-topic");
                  s.jmsQueue("my-queue");
                }));

    // Start the container
    swarm.start();

    JAXRSArchive appDeployment = ShrinkWrap.create(JAXRSArchive.class);
    appDeployment.addResource(MyResource.class);

    // Deploy your app
    swarm.deploy(appDeployment);

    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.addClass(MyService.class);
    deployment.as(ServiceActivatorArchive.class).addServiceActivator(MyServiceActivator.class);

    // Deploy the services
    swarm.deploy(deployment);
  }
Exemplo n.º 2
0
 public static void main(String[] args) throws Exception {
   Swarm container = new Swarm();
   JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
   deployment.addPackage(Main.class.getPackage());
   deployment.addAllDependencies();
   // deployment.as( RibbonArchive.class );
   container.start().deploy(deployment);
 }
Exemplo n.º 3
0
  public static void main(String[] args) throws Exception {
    Swarm swarm = new Swarm();

    JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "events.war");
    deployment.addPackage(Main.class.getPackage());
    deployment.addAllDependencies();
    deployment.as(RibbonArchive.class).advertise();
    swarm.start().deploy(deployment);
  }
Exemplo n.º 4
0
 public static void main(String... args) throws Exception {
   Swarm container = new Swarm();
   container.fraction(new ManagementConsoleFraction());
   container.start();
 }