@Override public void start(final Deployment dep) { if (BusFactory.getDefaultBus(false) == null) { //Make sure the default bus is created and set for client side usage //(i.e. no server side integration contribution in it) JBossWSBusFactory.getDefaultBus(Provider.provider().getClass().getClassLoader()); } startDeploymentBus(dep); }
JBossWSBusFactory.getDefaultBus(clientClassLoader);
private void setUserEndpointBus(final Deployment dep) { //first make sure the global default bus is built with visibility over client dependencies only final ClassLoader clientClassLoader = ProviderImpl.class.getClassLoader(); if (BusFactory.getDefaultBus(false) == null) { JBossWSBusFactory.getDefaultBus(clientClassLoader); } final ClassLoader cl = SecurityActions.getContextClassLoader(); try { //then set the TCCL to a delegate classloader adding jbws client integration to user deployment dependencies SecurityActions.setContextClassLoader(createDelegateClassLoader(clientClassLoader, dep.getClassLoader())); final Bus userBus = BusFactory.newInstance().createBus(); //finally, create a new Bus instance to be later assigned to the thread running the user endpoint business methods for (final Endpoint ep : dep.getService().getEndpoints()) { ep.addAttachment(Bus.class, userBus); } } finally { SecurityActions.setContextClassLoader(cl); } }