Package org.jboss.jms.jndi

Examples of org.jboss.jms.jndi.JMSProviderAdapter


    // Now install local JMSProviderAdaptor classes

    Properties p1 = new Properties();
    p1.putAll(ServerManagement.getJNDIEnvironment(1));

    JMSProviderAdapter targetAdaptor = new TestJMSProviderAdaptor(p1,
        "/XAConnectionFactory", "adaptor1");

    sc.installJMSProviderAdaptor("adaptor1", targetAdaptor);

    sc.startRecoveryManager();
View Full Code Here


/* 307 */       throw new IllegalArgumentException("Null provider name");
/* 308 */     String providerAdapterJNDI = this.providerName;
/* 309 */     if (!providerAdapterJNDI.startsWith("java:"))
/* 310 */       providerAdapterJNDI = "java:" + providerAdapterJNDI;
/* 311 */     Context ctx = new InitialContext();
/* 312 */     JMSProviderAdapter adapter = (JMSProviderAdapter)Util.lookup(providerAdapterJNDI, JMSProviderAdapter.class);
/*     */
/* 315 */     String connectionFactoryRef = adapter.getFactoryRef();
/* 316 */     if (connectionFactoryRef == null) {
/* 317 */       throw new IllegalStateException("Provider '" + this.providerName + "' has no FactoryRef");
/*     */     }
/*     */
/* 320 */     ctx = adapter.getInitialContext();
/*     */     try
/*     */     {
/* 323 */       localXAConnectionFactory = (XAConnectionFactory)Util.lookup(ctx, connectionFactoryRef, XAConnectionFactory.class);
/*     */     }
/*     */     finally
View Full Code Here

/*     */   {
/* 339 */     if (this.providerName == null)
/* 340 */       throw new IllegalArgumentException("Null provider name");
/* 341 */     Context ctx = new InitialContext();
/*     */
/* 343 */     JMSProviderAdapter adapter = (JMSProviderAdapter)ctx.lookup(this.providerName);
/*     */
/* 346 */     String connectionFactoryRef = adapter.getFactoryRef();
/* 347 */     if (connectionFactoryRef == null) {
/* 348 */       throw new IllegalStateException("Provider '" + this.providerName + "' has no FactoryRef");
/*     */     }
/*     */
/* 351 */     ctx = adapter.getInitialContext();
/*     */     try
/*     */     {
/* 354 */       XAConnectionFactory localXAConnectionFactory = (XAConnectionFactory)Util.lookup(ctx, connectionFactoryRef, XAConnectionFactory.class);
/*     */       return localXAConnectionFactory;
/*     */     }
View Full Code Here

/*     */   }
/*     */
/*     */   private JMSProviderAdapter getProviderAdapter()
/*     */     throws NamingException
/*     */   {
/*     */     JMSProviderAdapter adapter;
/* 633 */     if (this.mcf.getJmsProviderAdapterJNDI() != null)
/*     */     {
/* 636 */       Context ctx = new InitialContext();
/*     */       try
/*     */       {
/* 639 */         adapter = (JMSProviderAdapter)ctx.lookup(this.mcf.getJmsProviderAdapterJNDI());
/*     */       }
/*     */       finally
/*     */       {
/*     */         JMSProviderAdapter adapter;
/* 644 */         ctx.close();
/*     */       }
/*     */     }
/*     */     else {
/* 648 */       adapter = this.mcf.getJmsProviderAdapter();
View Full Code Here

/*     */     throws ResourceException
/*     */   {
/* 660 */     boolean trace = log.isTraceEnabled();
/*     */     try
/*     */     {
/* 664 */       JMSProviderAdapter adapter = getProviderAdapter();
/* 665 */       Context context = adapter.getInitialContext();
/*     */
/* 667 */       boolean transacted = this.info.isTransacted();
/* 668 */       int ack = 1;
/*     */
/* 670 */       if (this.info.getType() == 2)
/*     */       {
/* 672 */         String jndi = adapter.getTopicFactoryRef();
/* 673 */         if (jndi == null)
/* 674 */           throw new IllegalStateException("No configured 'TopicFactoryRef' on the jms provider " + this.mcf.getJmsProviderAdapterJNDI());
/* 675 */         Object factory = context.lookup(jndi);
/* 676 */         this.con = ConnectionFactoryHelper.createTopicConnection(factory, this.user, this.pwd);
/* 677 */         if (this.info.getClientID() != null)
/* 678 */           this.con.setClientID(this.info.getClientID());
/* 679 */         this.con.setExceptionListener(this);
/* 680 */         if (trace) {
/* 681 */           log.trace("created connection: " + this.con);
/*     */         }
/* 683 */         if ((this.con instanceof XATopicConnection))
/*     */         {
/* 685 */           this.xaTopicSession = ((XATopicConnection)this.con).createXATopicSession();
/* 686 */           this.topicSession = this.xaTopicSession.getTopicSession();
/* 687 */           this.xaTransacted = true;
/*     */         }
/* 689 */         else if ((this.con instanceof TopicConnection))
/*     */         {
/* 691 */           this.topicSession = ((TopicConnection)this.con).createTopicSession(transacted, ack);
/*     */
/* 693 */           if (trace)
/* 694 */             log.trace("Using a non-XA TopicConnection.  It will not be able to participate in a Global UOW");
/*     */         }
/*     */         else
/*     */         {
/* 698 */           throw new JBossResourceException("Connection was not recognizable: " + this.con);
/*     */         }
/* 700 */         if (trace)
/* 701 */           log.trace("xaTopicSession=" + this.xaTopicSession + ", topicSession=" + this.topicSession);
/*     */       }
/* 703 */       else if (this.info.getType() == 1)
/*     */       {
/* 705 */         String jndi = adapter.getQueueFactoryRef();
/* 706 */         if (jndi == null)
/* 707 */           throw new IllegalStateException("No configured 'QueueFactoryRef' on the jms provider " + this.mcf.getJmsProviderAdapterJNDI());
/* 708 */         Object factory = context.lookup(jndi);
/* 709 */         this.con = ConnectionFactoryHelper.createQueueConnection(factory, this.user, this.pwd);
/* 710 */         if (this.info.getClientID() != null)
/* 711 */           this.con.setClientID(this.info.getClientID());
/* 712 */         this.con.setExceptionListener(this);
/* 713 */         if (trace) {
/* 714 */           log.debug("created connection: " + this.con);
/*     */         }
/* 716 */         if ((this.con instanceof XAQueueConnection))
/*     */         {
/* 718 */           this.xaQueueSession = ((XAQueueConnection)this.con).createXAQueueSession();
/*     */
/* 720 */           this.queueSession = this.xaQueueSession.getQueueSession();
/* 721 */           this.xaTransacted = true;
/*     */         }
/* 723 */         else if ((this.con instanceof QueueConnection))
/*     */         {
/* 725 */           this.queueSession = ((QueueConnection)this.con).createQueueSession(transacted, ack);
/*     */
/* 727 */           if (trace)
/* 728 */             log.trace("Using a non-XA QueueConnection.  It will not be able to participate in a Global UOW");
/*     */         }
/*     */         else
/*     */         {
/* 732 */           throw new JBossResourceException("Connection was not reconizable: " + this.con);
/*     */         }
/* 734 */         if (trace)
/* 735 */           log.trace("xaQueueSession=" + this.xaQueueSession + ", queueSession=" + this.queueSession);
/*     */       }
/*     */       else
/*     */       {
/* 739 */         String jndi = adapter.getFactoryRef();
/* 740 */         if (jndi == null)
/* 741 */           throw new IllegalStateException("No configured 'FactoryRef' on the jms provider " + this.mcf.getJmsProviderAdapterJNDI());
/* 742 */         Object factory = context.lookup(jndi);
/* 743 */         this.con = ConnectionFactoryHelper.createConnection(factory, this.user, this.pwd);
/* 744 */         if (this.info.getClientID() != null)
View Full Code Here

/*     */   {
/* 124 */     JmsActivationSpec spec = this.activation.getActivationSpec();
/* 125 */     String user = spec.getDLQUser();
/* 126 */     String pass = spec.getDLQPassword();
/* 127 */     String clientID = spec.getDLQClientID();
/* 128 */     JMSProviderAdapter adapter = this.activation.getProviderAdapter();
/* 129 */     String queueFactoryRef = adapter.getQueueFactoryRef();
/* 130 */     log.debug("Attempting to lookup dlq connection factory " + queueFactoryRef);
/* 131 */     QueueConnectionFactory qcf = (QueueConnectionFactory)Util.lookup(ctx, queueFactoryRef, QueueConnectionFactory.class);
/* 132 */     log.debug("Got dlq connection factory " + qcf + " from " + queueFactoryRef);
/* 133 */     log.debug("Attempting to create queue connection with user " + user);
/* 134 */     if (user != null)
View Full Code Here

/*     */   }
/*     */
/*     */   protected void jmsCreate()
/*     */     throws Exception
/*     */   {
/* 349 */     JMSProviderAdapter adapter = getJMSProviderAdapter();
/* 350 */     log.debug("Provider adapter: " + adapter);
/*     */
/* 353 */     Context context = adapter.getInitialContext();
/* 354 */     log.debug("context: " + context);
/*     */
/* 357 */     if (context == null)
/*     */     {
/* 359 */       throw new RuntimeException("Failed to get the root context");
View Full Code Here

      //Now install local JMSProviderAdaptor classes
     
      Properties props1 = new Properties();
      props1.putAll(ServerManagement.getJNDIEnvironment(1));
       
      JMSProviderAdapter targetAdaptor =
         new TestJMSProviderAdaptor(props1, "/XAConnectionFactory", "adaptor1");
     
      sc.installJMSProviderAdaptor("adaptor1", targetAdaptor);
     
      sc.startRecoveryManager();     
View Full Code Here

TOP

Related Classes of org.jboss.jms.jndi.JMSProviderAdapter

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.