The JBoss deployer will actually create a new jbi container if you deploy a
xxx-sm.xml file.
However, you can also deploy standard JBI components and service assemblies
by just copying them
to the jboss deploy directory and they will all use the same JBI container.
Cheers,
Guillaume Nodet
On 7/25/06, Timothy High <[EMAIL PROTECTED]> wrote:
Hi all,
I am working on a way to access the JBIContainer from my JBoss application
so that I can create a local client to send messages. I thought I had
finally succeeded by adding an accessor method to the JBIServer class:
public JBIContainer getJbiContainer() {
return jbiContainer;
}
Then, my application uses the JBoss MBean server to access the
JBIServerMBean and get the JBIContext:
private JBIContainer getJbiContainer() throws
MalformedObjectNameException {
MBeanServer server =
MBeanServerLocator.locateJBoss();
JBIServiceMBean proxy = null;
String objName = "
org.apache.servicemix:service=JBIService";
ObjectName objectName = new ObjectName(objName);
if (server.isRegistered(objectName)) {
// Get a type-safe dynamic proxy
proxy = (JBIServiceMBean)
MBeanServerInvocationHandler.newProxyInstance(
(MBeanServerConnection)
server, objectName,
JBIServiceMBean.class, false);
} else {
throw new
IllegalArgumentException("MBean " + objName
+ " does not
exist");
}
return proxy.getJbiContainer();
}
So far, so good. However, when I try to send a message using this
container, it can't locate the endpoint or service requested. After some
debugging, I discovered that the JBIContainer registry is empty. In fact,
what the JBoss deployer is doing is creating a separate SpringJBIContainer
for each ServiceMix SA I deploy (actually, I'm currently just testing with
simple XML configurations):
public void installServiceMixXml(String archive) {
// Ok, we are going to use the spring
infrastructure
// to create a container
log
.info("Creating ServiceMix
JBI installer from XML [" + archive
+
"]");
List processors = Arrays.asList(new Object[] { new
XBeanProcessor() });
containerMap.put(archive, new
ClassPathXmlApplicationContext(archive,
processors));
}
So, none of the deployed assemblies have access to any other assemblies -
each one has effectively its own separate container. Is this the expected
behavior? Is this how the stand-alone ServiceMix server works? I had assumed
that you would want a single registry so that components in one assembly
could communicate with services in another.
Could someone please clarify this for me?
Thanks,
Tim.
----------------------------------------------------------
Timothy High
Software Engineering
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Sakonnet Technology
Centro Empresarial Mourisco
Praia de Botafogo 501 1°Andar
Bloco A - Torre Pão de Açúcar
22250-040 - Rio de Janeiro, RJ Brazil
www.sknt.com <http://www.sknt.com/>
+55 (21) 2586 6102 direct
+55 (21) 2586 6001 fax