diff --git a/pom.xml b/pom.xml index 7f9ef4862a2cb3b44c7695b466dc29171becc2da..120f57f0c39b7a2f5f18e4bd93db6de7f0f87a70 100644 --- a/pom.xml +++ b/pom.xml @@ -39,12 +39,12 @@ <version>1.6.0</version> <executions> <execution> - <id>server</id> + <id>broker</id> <goals> <goal>java</goal> </goals> <configuration> - <mainClass>ch.hepia.communication.Server</mainClass> + <mainClass>ch.hepia.communication.Broker</mainClass> </configuration> </execution> <execution> diff --git a/src/main/java/ch/hepia/communication/Server.java b/src/main/java/ch/hepia/communication/Server.java deleted file mode 100644 index 16a93c09188b1e26ff7fca1b5210618996c62198..0000000000000000000000000000000000000000 --- a/src/main/java/ch/hepia/communication/Server.java +++ /dev/null @@ -1,34 +0,0 @@ -package ch.hepia.communication; - -import javax.jms.Connection; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.apache.activemq.broker.BrokerService; - -public class Server { - - public Server(String ipBroker) { - try { - final String brokerUrl = "tcp://" + ipBroker + ":61616"; - final BrokerService broker = new BrokerService(); - - broker.setPersistent(false); - broker.setUseJmx(false); - broker.addConnector(brokerUrl); - broker.start(); - - final ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerUrl); - final Connection connection = connectionFactory.createConnection(); - connection.start(); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { - System.out.println(args[0]); - - new Server( args.length == 1 ? args[0] : "localhost"); - } -}