[jboss-user] [EJB3] - Re: Installing into JBoss 4.2.3 GA

Martin Husted Hartvig do-not-reply at jboss.com
Mon Jan 24 10:15:47 EST 2011


Martin Husted Hartvig [http://community.jboss.org/people/Hagar] created the discussion

"Re: Installing into JBoss 4.2.3 GA"

To view the discussion, visit: http://community.jboss.org/message/582804#582804

--------------------------------------------------------------
Hi Federico,

This is the changes I made:

   @Override
   public void createDestination(Class<? extends Destination> type, String jndiSuffix) throws Exception
   {
      String methodName;
      String destinationContext;
      if (type == Topic.class)
      {
         destinationContext = "topic";
         methodName = "deployTopic";
      }
      else if (type == Queue.class)
      {
         destinationContext = "queue";
         methodName = "deployQueue";
      }
      else
      {
         // type was not a Topic or Queue, bad user
         throw new IllegalArgumentException
                 ("Expected javax.jms.Queue or javax.jms.Topic: " + type);
      }

      String jndiName = (new StringBuilder()).append(destinationContext).append("/").append(jndiSuffix).toString();
      ObjectName destinationManagerName = new ObjectName("jboss.messaging:service=ServerPeer");

      KernelAbstraction kernel = KernelAbstractionFactory.getInstance();
      // invoke the server to create the destination
      Object result = kernel.invoke(destinationManagerName,
              methodName,
              new Object[]{jndiSuffix, jndiName},
              new String[]{"java.lang.String", "java.lang.String"});

   }


Rebuild the project and drop the jar into the depoly/ejb3.deployer folder. Hope this helps you...

Regards,
Martin
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/582804#582804]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110124/f962162e/attachment.html 


More information about the jboss-user mailing list