Java Code Examples for org.wildfly.swarm.jaxrs.JAXRSArchive#setContextRoot()
The following examples show how to use
org.wildfly.swarm.jaxrs.JAXRSArchive#setContextRoot() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: App.java From drools-workshop with Apache License 2.0 | 6 votes |
public static void main(String[] args) throws Exception { Container container = new Container(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class); deployment.as(TopologyArchive.class).advertise("restaurantService"); deployment.setContextRoot("/api"); deployment.addPackages(true, "org.jboss.shrinkwrap.api"); deployment.addAsLibrary(container.createDefaultDeployment()); deployment.addAllDependencies(); container.start(); container.deploy(deployment); Topology lookup = Topology.lookup(); lookup.addListener(new TopologyListener() { @Override public void onChange(Topology tplg) { System.out.println(">>> Delivery Service: The Topology Has Changed!"); printTopology(lookup); } }); printTopology(lookup); }
Example 2
Source File: App.java From drools-workshop with Apache License 2.0 | 6 votes |
public static void main(String[] args) throws Exception { Container container = new Container(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class); deployment.as(TopologyArchive.class).advertise("deliveryService"); deployment.setContextRoot("/api"); deployment.addPackages(true, "org.jboss.shrinkwrap.api"); deployment.addAsLibrary(container.createDefaultDeployment()); deployment.addAllDependencies(); container.start(); container.deploy(deployment); Topology lookup = Topology.lookup(); lookup.addListener(new TopologyListener() { @Override public void onChange(Topology tplg) { System.out.println(">>> Delivery Service: The Topology Has Changed!"); printTopology(lookup); } }); printTopology(lookup); }
Example 3
Source File: App.java From drools-workshop with Apache License 2.0 | 6 votes |
public static void main(String[] args) throws Exception { Container container = new Container(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class); deployment.as(TopologyArchive.class).advertise("foodService"); deployment.setContextRoot("/api"); deployment.addPackages(true, "org.jboss.shrinkwrap.api"); deployment.addAsLibrary(container.createDefaultDeployment()); deployment.addAllDependencies(); container.start(); container.deploy(deployment); Topology lookup = Topology.lookup(); lookup.addListener(new TopologyListener() { @Override public void onChange(Topology tplg) { System.out.println(">>> Delivery Service: The Topology Has Changed!"); printTopology(lookup); } }); printTopology(lookup); }
Example 4
Source File: Main.java From thorntail with Apache License 2.0 | 5 votes |
public static void main(String... args) throws Exception { swarm = new Swarm(args); swarm.start(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "myapp.war"); deployment.addClass(MyResource.class); deployment.setContextRoot("rest"); deployment.addAllDependencies(); swarm.deploy(deployment); }
Example 5
Source File: App.java From drools-workshop with Apache License 2.0 | 5 votes |
public static void main(String[] args) throws Exception { Container container = new Container(); container.start(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class); deployment.setContextRoot("/api"); deployment.addResource(ShoppingCartService.class); deployment.addResource(ShoppingCartServiceImpl.class); deployment.addClass(HttpStatusExceptionHandler.class); deployment.addClass(BusinessException.class); deployment.addAllDependencies(); container.deploy(deployment); }
Example 6
Source File: App.java From drools-workshop with Apache License 2.0 | 5 votes |
public static void main(String[] args) throws Exception { Container container = new Container(); container.start(); JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class); deployment.setContextRoot("/cep"); deployment.addResource(TransactionEventService.class); deployment.addResource(TransactionEventServiceImpl.class); deployment.addClass(HttpStatusExceptionHandler.class); deployment.addClass(BusinessException.class); deployment.addAllDependencies(); container.deploy(deployment); }