Examples of TopicConnectionFactory


Examples of com.sun.messaging.TopicConnectionFactory

            ConnectionFactory cf;
            if (refClassName.equals(com.sun.messaging.QueueConnectionFactory.class.getName())) {
                cf = new QueueConnectionFactory();
            } else {
                if (refClassName.equals(com.sun.messaging.TopicConnectionFactory.class.getName())) {
                    cf = new TopicConnectionFactory();
                } else {
                    throw new MissingVersionNumberException();
                }
            }
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

      // Get the initial context
      Context jndicontext = getInitialContext();

      // Get the connection factory
      TopicConnectionFactory topicFactory =
   (TopicConnectionFactory)jndicontext.lookup( "ConnectionFactory");

      // Create the connection
      topicConnection = topicFactory.createTopicConnection();

      // Create the session with: No transaction and auto ack
      topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      // Look up the destination
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

      // Get the initial context
      Context jndicontext = getInitialContext();

      // Get the connection factory
      TopicConnectionFactory topicFactory =
    (TopicConnectionFactory)jndicontext.lookup("ConnectionFactory");

      // Create the connection
      topicConnection = topicFactory.createTopicConnection();

      // Create the session with: No Transaction  and Auto ack
      topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      // Look up the destination
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

        QueueConnectionFactory factory = QueueTcpConnectionFactory.create(hostName, serverPort);
        setFactoryParameters((AbstractConnectionFactory) factory, (ManagedConnectionFactoryImpl) mcf);
        ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
        return factory.createQueueConnection(userName, password);
      } else if (cxRequest instanceof TopicConnectionRequest) {
        TopicConnectionFactory factory = TopicTcpConnectionFactory.create(hostName, serverPort);
        setFactoryParameters((AbstractConnectionFactory) factory, (ManagedConnectionFactoryImpl) mcf);
        ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
        return factory.createTopicConnection(userName, password);
      } else {
        ConnectionFactory factory = TcpConnectionFactory.create(hostName, serverPort);
        setFactoryParameters((AbstractConnectionFactory) factory, (ManagedConnectionFactoryImpl) mcf);
        ((AbstractConnectionFactory) factory).setIdentityClassName(identityClass);
        return factory.createConnection(userName, password);
      }
    } catch (IllegalStateException exc) {
      throw new CommException("Could not access the JORAM server: " + exc);
    } catch (JMSSecurityException exc) {
      throw new SecurityException("Invalid user identification: " + exc);
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

                                                       addrDetails.getConnectionPassword());
            } else {
                connection = qcf.createQueueConnection();
            }
        } else {
            TopicConnectionFactory tcf =
                (TopicConnectionFactory)context.lookup(addrDetails.getJndiConnectionFactoryName());
            if (addrDetails.isSetConnectionUserName()) {
                connection = tcf.createTopicConnection(addrDetails.getConnectionUserName(),
                                                       addrDetails.getConnectionPassword());
            } else {
                connection = tcf.createTopicConnection();
            }
        }

        connection.start();
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

   }
  
   public void prepare() throws JMSException {
      try {
         // create a factory (normally retreived by naming service)
         TopicConnectionFactory factory = new XBConnectionFactory(null, this.cmdLine, false);
         // should be retreived via jndi
         Topic topic = new XBDestination("jms-test", null, false);
     
         TopicConnection connection = factory.createTopicConnection();
         connection.start();
         TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
         TopicSubscriber subscriber = session.createSubscriber(topic);
         subscriber.setMessageListener(this);
     
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

   /**
    * Test introduced as a result of a TCK failure.
    */
   public void testNonDurableSubscriberOnNullTopic() throws Exception
   {
      TopicConnectionFactory cf = (TopicConnectionFactory)ic.lookup("ConnectionFactory");
      TopicConnection conn = cf.createTopicConnection();

      TopicSession ts = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      try
      {
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

    * Test that ConnectionFactory can be cast to TopicConnectionFactory and TopicConnection can be
    * created.
    */
   public void testTopicConnectionFactory() throws Exception
   {
      TopicConnectionFactory qcf =
         (TopicConnectionFactory)initialContext.lookup("/ConnectionFactory");
      TopicConnection tc = qcf.createTopicConnection();
      tc.close();
   }
View Full Code Here

Examples of javax.jms.TopicConnectionFactory

   /**
    * Test creation of TopicSession
    */
   public void testQueueConnection2() throws Exception
   {
      TopicConnectionFactory tcf = (TopicConnectionFactory)cf;

      TopicConnection tc = tcf.createTopicConnection();

      tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      tc.close();

View Full Code Here

Examples of javax.jms.TopicConnectionFactory

   /**
    * Test introduced as a result of a TCK failure.
    */
   public void testNonDurableSubscriberInvalidUnsubscribe() throws Exception
   {
      TopicConnectionFactory cf = (TopicConnectionFactory)ic.lookup("ConnectionFactory");
      TopicConnection conn = cf.createTopicConnection();
      conn.setClientID("sofiavergara");

      TopicSession ts = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

      try
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.