Package org.apache.activemq

Examples of org.apache.activemq.ActiveMQConnectionFactory


  public void run() {
    // Connection connection = null;
    ActiveMQConnection connection = null;
    try {
      // Create the connection.
      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
      connection = (ActiveMQConnection) connectionFactory.createConnection();
      connection.start();
      // Create the session
      Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
      if (topic) {
        destination = session.createTopic(subject);
View Full Code Here


  }

  public void run() {
    try {
      running = true;
      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
      connection = (ActiveMQConnection) connectionFactory.createConnection();
      if (durable && clientId != null && clientId.length() > 0 && !"null".equals(clientId)) {
        connection.setClientID(clientId);
      }
//      connection.setExceptionListener(this);
      connection.start();
View Full Code Here

    public void run() {
        try {
            running = true;

            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
            Connection connection = connectionFactory.createConnection();
            if (durable && clientId != null && clientId.length() > 0 && !"null".equals(clientId)) {
                connection.setClientID(clientId);
            }
            connection.setExceptionListener(this);
            connection.start();
View Full Code Here

    public void run() {
//        Connection connection = null;
      ActiveMQConnection  connection = null;
        try {
            // Create the connection.
            ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);
            connection = (ActiveMQConnection) connectionFactory.createConnection();
            connection.start();

            // Create the session
            Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
            if (topic) {
View Full Code Here

    if (ICalFileCalendarManagerTest.isInitialized == false) {
      DBFactory.getJunitInstance().clearDatabase();
      test = ManagerFactory.getManager().createAndPersistIdentity("test", null, OLATAuthenticationController.PROVIDER_OLAT, "test",
          Encoder.encrypt("test"));
      // Setup for code-points
      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
      ActiveMQQueue queue = new ActiveMQQueue("olat/codepoints");
      codepointServer_ = new JMSCodepointServer(connectionFactory, queue, CODEPOINT_SERVER_ID);
      CodepointInstaller.installCodepointServer(codepointServer_);
      System.out.println("Codepoint server startet");
      ICalFileCalendarManagerTest.isInitialized = true;
View Full Code Here

        identity2 = ManagerFactory.getManager().createAndPersistIdentity("foo2", u2, OLATAuthenticationController.PROVIDER_OLAT, "foo2", Encoder.encrypt("hashipassi2"));
        User u3 = UserManager.getInstance().createAndPersistUser("fi3", "la3", "user3@bla.com");
        identity3 = ManagerFactory.getManager().createAndPersistIdentity("foo3", u3, OLATAuthenticationController.PROVIDER_OLAT, "foo3", Encoder.encrypt("hashipassi3"));
       
        // Setup for code-points
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        ActiveMQQueue queue = new ActiveMQQueue("olat/codepoints");
        codepointServer_ = new JMSCodepointServer(connectionFactory, queue, CODEPOINT_SERVER_ID);
        CodepointInstaller.installCodepointServer(codepointServer_);
        System.out.println("Codepoint server startet");
       
View Full Code Here

    super.setUp();
    if (OLATResourceManagerTest.isInitialized == false) {
      try {
        DBFactory.getJunitInstance().clearDatabase();
        // Setup for code-points
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        ActiveMQQueue queue = new ActiveMQQueue("olat/codepoints");
        codepointServer_ = new JMSCodepointServer(connectionFactory, queue, CODEPOINT_SERVER_ID);
        CodepointInstaller.installCodepointServer(codepointServer_);
        System.out.println("Codepoint server startet");
View Full Code Here

  public void setUp() {
    if (RepositoryManagerTest.isInitialized == false) {
      try {
        DBFactory.getJunitInstance().clearDatabase();
        // Setup for code-points
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        ActiveMQQueue queue = new ActiveMQQueue("olat/codepoints");
        codepointServer_ = new JMSCodepointServer(connectionFactory, queue, CODEPOINT_SERVER_ID);
        CodepointInstaller.installCodepointServer(codepointServer_);
        System.out.println("Codepoint server startet");
View Full Code Here

    System.out.println(" Hint: brokerUrl is something like tcp://localhost:61616");
    System.exit(1);
  }

  private static void go(String brokerUrl, String topicName) throws JMSException {
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
    connectionFactory.setBrokerURL(brokerUrl);
    Connection connection = connectionFactory.createConnection();
    ActiveMQTopic topic = new ActiveMQTopic(topicName);
    MessageConsumer consumer = connection.createSession(false, Session.AUTO_ACKNOWLEDGE).createConsumer(topic);
    connection.start();
    while(true) {
      Message m = consumer.receive();
View Full Code Here

    }
    FileUtils.deleteDirectory(baseDir);
  }

  private void putQueue(List<String> events) throws Exception {
    ConnectionFactory factory = new ActiveMQConnectionFactory(USERNAME,
        PASSWORD, BROKER_BIND_URL);
    Connection connection = factory.createConnection();
    connection.start();

    Session session = connection.createSession(true,
        Session.AUTO_ACKNOWLEDGE);
    Destination destination = session.createQueue(DESTINATION_NAME);
View Full Code Here

TOP

Related Classes of org.apache.activemq.ActiveMQConnectionFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.