@Override public Object getInstance() { return instance.getInstance(); } }
@Override public Object getInstance() { return componentInstance.getInstance(); } };
@Override public Object processInvocation(final InterceptorContext context) throws Exception { final Object instance = context.getPrivateData(ComponentInstance.class).getInstance(); try { return method.invoke(instance, context.getPrivateData(PARAMETERS_KEY)); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
public Object processInvocation(final InterceptorContext context) throws Exception { ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); if (componentInstance == null) { throw EeLogger.ROOT_LOGGER.noComponentInstance(); } Method oldMethod = context.getMethod(); try { context.setMethod(componentMethod); context.setTarget(componentInstance.getInstance()); return componentInstance.getInterceptor(componentMethod).processInvocation(context); } finally { context.setMethod(oldMethod); context.setTarget(null); } } }
@Override public Object getInstance() { return instance.getInstance(); } }
@Override public Object getInstance() { return instance.getInstance(); } }
@Override public Object processInvocation(final InterceptorContext context) throws Exception { final Object instance = context.getPrivateData(ComponentInstance.class).getInstance(); try { return method.invoke(instance, context.getPrivateData(PARAMETERS_KEY)); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
@Override public Object processInvocation(InterceptorContext context) throws Exception { ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); Object serviceInstance = componentInstance.getInstance(); Method serviceMethod = context.getMethod(); Class serviceClass = serviceInstance.getClass(); Object result; ProtocolHandler protocolHandler = HandlerFactory.getInstance(new ServiceInvocationMeta(serviceInstance, serviceClass, serviceMethod)); try { protocolHandler.preInvocation(); result = context.proceed(); protocolHandler.notifySuccess(); } catch (Exception e) { protocolHandler.notifyFailure(); throw e; } return result; } }
@Override public synchronized Reference getInstance(final String className) { Reference instance = cache.get(className); if (instance != null) return instance; if (!className.equals(endpointClass)) { // handle JAXWS handler instantiation final ServiceName handlerComponentName = getHandlerComponentServiceName(className); final ServiceController<BasicComponent> handlerComponentController = getComponentController(handlerComponentName); if (handlerComponentController != null) { // we support initialization only on non system JAXWS handlers final BasicComponent handlerComponent = handlerComponentController.getValue(); final ComponentInstance handlerComponentInstance = handlerComponent.createInstance(delegate.getInstance(className).getValue()); final Object handlerInstance = handlerComponentInstance.getInstance(); // mark reference as initialized because JBoss server initialized it final Reference handlerReference = ReferenceFactory.newInitializedReference(handlerInstance); return cacheAndGet(handlerReference); } } // fallback for system JAXWS handlers final Reference fallbackInstance = delegate.getInstance(className); final Reference fallbackReference = ReferenceFactory.newUninitializedReference(fallbackInstance); return cacheAndGet(fallbackReference); }
@Override public synchronized Reference getInstance(final String className) { Reference instance = cache.get(className); if (instance != null) return instance; if (!className.equals(endpointClass)) { // handle JAXWS handler instantiation final ServiceName handlerComponentName = getHandlerComponentServiceName(className); final ServiceController<BasicComponent> handlerComponentController = getComponentController(handlerComponentName); if (handlerComponentController != null) { // we support initialization only on non system JAXWS handlers final BasicComponent handlerComponent = handlerComponentController.getValue(); final ComponentInstance handlerComponentInstance = handlerComponent.createInstance(delegate.getInstance(className).getValue()); final Object handlerInstance = handlerComponentInstance.getInstance(); // mark reference as initialized because JBoss server initialized it final Reference handlerReference = ReferenceFactory.newInitializedReference(handlerInstance); return cacheAndGet(handlerReference); } } // fallback for system JAXWS handlers final Reference fallbackInstance = delegate.getInstance(className); final Reference fallbackReference = ReferenceFactory.newUninitializedReference(fallbackInstance); return cacheAndGet(fallbackReference); }
@Override public synchronized Reference getInstance(final String className) { Reference instance = cache.get(className); if (instance != null) return instance; if (!className.equals(endpointClass)) { // handle JAXWS handler instantiation final ServiceName handlerComponentName = getHandlerComponentServiceName(className); final ServiceController<BasicComponent> handlerComponentController = getComponentController(handlerComponentName); if (handlerComponentController != null) { // we support initialization only on non system JAXWS handlers final BasicComponent handlerComponent = handlerComponentController.getValue(); final ComponentInstance handlerComponentInstance = handlerComponent.createInstance(delegate.getInstance(className).getValue()); final Object handlerInstance = handlerComponentInstance.getInstance(); // mark reference as initialized because JBoss server initialized it final Reference handlerReference = ReferenceFactory.newInitializedReference(handlerInstance); return cacheAndGet(handlerReference); } } // fallback for system JAXWS handlers final Reference fallbackInstance = delegate.getInstance(className); final Reference fallbackReference = ReferenceFactory.newUninitializedReference(fallbackInstance); return cacheAndGet(fallbackReference); }
public Object processInvocation(final InterceptorContext context) throws Exception { ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); if (componentInstance == null) { throw EeLogger.ROOT_LOGGER.noComponentInstance(); } Method oldMethod = context.getMethod(); try { context.setMethod(componentMethod); context.setTarget(componentInstance.getInstance()); return componentInstance.getInterceptor(componentMethod).processInvocation(context); } finally { context.setMethod(oldMethod); context.setTarget(null); } } }
public Object processInvocation(final InterceptorContext context) throws Exception { ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); if (componentInstance == null) { throw MESSAGES.noComponentInstance(); } Method oldMethod = context.getMethod(); try { context.setMethod(componentMethod); context.setTarget(componentInstance.getInstance()); return componentInstance.getInterceptor(componentMethod).processInvocation(context); } finally { context.setMethod(oldMethod); context.setTarget(null); } } }
public Object processInvocation(final InterceptorContext context) throws Exception { ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); if (componentInstance == null) { throw EeLogger.ROOT_LOGGER.noComponentInstance(); } Method oldMethod = context.getMethod(); try { context.setMethod(componentMethod); context.setTarget(componentInstance.getInstance()); return componentInstance.getInterceptor(componentMethod).processInvocation(context); } finally { context.setMethod(oldMethod); context.setTarget(null); } } }
@Override public void start(StartContext context) throws StartException { XBundle bundle = injectedBundle.getValue(); Deployment deployment = depUnit.getAttachment(OSGiConstants.DEPLOYMENT_KEY); BundleManager bundleManager = depUnit.getAttachment(OSGiConstants.BUNDLE_MANAGER_KEY); Component activatorComponent = injectedComponent.getOptionalValue(); if (activatorComponent != null && deployment.getAttachment(BundleActivator.class) == null) { ComponentInstance componentInstance = activatorComponent.createInstance(); BundleActivator instance = (BundleActivator) componentInstance.getInstance(); deployment.addAttachment(BundleActivator.class, instance); } OperationAssociation.INSTANCE.setAssociation(new ModelNode("deploy")); try { bundleManager.startBundle(bundle, Bundle.START_ACTIVATION_POLICY); depUnit.putAttachment(Attachments.BUNDLE_STATE_KEY, BundleState.ACTIVE); } catch (BundleException ex) { throw MESSAGES.cannotStartBundle(ex, bundle); } finally { OperationAssociation.INSTANCE.removeAssociation(); } }
@Override public void start(StartContext context) throws StartException { Deployment deployment = depUnit.getAttachment(OSGiConstants.DEPLOYMENT_KEY); BundleManager bundleManager = depUnit.getAttachment(OSGiConstants.BUNDLE_MANAGER_KEY); Component activatorComponent = injectedComponent.getOptionalValue(); if (activatorComponent != null && deployment.getAttachment(BUNDLE_ACTIVATOR_KEY) == null) { ComponentInstance componentInstance = activatorComponent.createInstance(); BundleActivator instance = (BundleActivator) componentInstance.getInstance(); deployment.putAttachment(BUNDLE_ACTIVATOR_KEY, instance); } if (bundle.getState() != Bundle.ACTIVE) { try { bundleManager.startBundle(bundle, Bundle.START_ACTIVATION_POLICY); depUnit.putAttachment(Attachments.BUNDLE_STATE_KEY, BundleState.ACTIVE); } catch (BundleException ex) { throw MESSAGES.cannotStartBundle(ex, bundle); } } }