protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean, targetBean.getClass().getClassLoader()); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean, targetBean.getClass().getClassLoader()); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean, targetBean.getClass().getClassLoader()); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception { InvocationContext invCtx = epInv.getInvocationContext(); Object targetBean = invCtx.getTargetBean(); if (targetBean == null) { try { Class<?> epImpl = ep.getTargetBeanClass(); targetBean = epImpl.newInstance(); invCtx.setTargetBean(targetBean); } catch (Exception ex) { throw new IllegalStateException("Cannot get target bean instance", ex); } JavaxAnnotationHelper.callPostConstructMethod(targetBean); ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); } return targetBean; }
endpoint.addAttachment(BindingCustomization.class, jaxbCustomizations);
/** * Injects resources on target bean and calls post construct method. * Finally it registers target bean for predestroy phase. * * @param endpoint used for predestroy phase registration process * @param invocation current invocation */ @Override public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) { final Object _targetBean = this.getTargetBean(invocation); // TODO: refactor injection to AS IL final Reference reference = endpoint.getInstanceProvider().getInstance(_targetBean.getClass().getName()); final Object targetBean = reference.getValue(); InjectionHelper.injectWebServiceContext(targetBean, ThreadLocalAwareWebServiceContext.getInstance()); if (!reference.isInitialized()) { InjectionHelper.callPostConstructMethod(targetBean); reference.setInitialized(); } endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean)); }
endpoint.addAttachment(BindingCustomization.class, jaxbCustomizations);
depEndpoint.addAttachment(Object.class, factory.getServiceBean()); if (ep.getService().getName().equals(depEp.getProperty(Message.WSDL_SERVICE)) && ep.getEndpointInfo().getName().equals(depEp.getProperty(Message.WSDL_PORT)) && ep.getEndpointInfo().getAddress().equals(depEp.getAddress()) ) { depEp.addAttachment(org.apache.cxf.endpoint.Endpoint.class, ep);
@Override public void start(Deployment dep) { for (Endpoint ep : dep.getService().getEndpoints()) { ServiceEndpointInvoker epInvoker = ep.getAttachment(ServiceEndpointInvoker.class); if (epInvoker == null) { if (isJaxrpcEjbEndpoint(ep)) { epInvoker = new ServiceEndpointInvokerEJB21(); } else { epInvoker = new ServiceEndpointInvoker(); } ep.addAttachment(ServiceEndpointInvoker.class, epInvoker); epInvoker.init(ep); } } } }
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); } }
endpoint.addAttachment(InjectionsMetaData.class, injectionsMD); endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
endpoint.addAttachment(InjectionsMetaData.class, injectionsMD); endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
@Override public void start(final StartContext context) { WSLogger.ROOT_LOGGER.starting(name); final String domainName = (String)endpoint.getProperty(SECURITY_DOMAIN_NAME); if (isElytronSecurityDomain(endpoint, domainName)) { if (EndpointType.JAXWS_EJB3.equals(endpoint.getType())) { endpoint.setSecurityDomainContext(new ElytronSecurityDomainContextImpl(this.ejbApplicationSecurityDomain.get().getSecurityDomain())); } else { endpoint.setSecurityDomainContext(new ElytronSecurityDomainContextImpl(this.elytronSecurityDomain.get())); } } else { endpoint.setSecurityDomainContext(new SecurityDomainContextImpl(securityDomainContext.get())); } if (EndpointType.JAXWS_EJB3.equals(endpoint.getType())) { final EJBViewMethodSecurityAttributesService ejbMethodSecurityAttributeService = this.ejbMethodSecurityAttributeService.get(); endpoint.addAttachment(EJBMethodSecurityAttributeProvider.class, new EJBMethodSecurityAttributesAdaptor(ejbMethodSecurityAttributeService)); } final List<RecordProcessor> processors = endpoint.getRecordProcessors(); for (final RecordProcessor processor : processors) { registerRecordProcessor(processor, endpoint); } final EndpointMetricsFactory endpointMetricsFactory = SPIProvider.getInstance().getSPI(EndpointMetricsFactory.class); endpoint.setEndpointMetrics(endpointMetricsFactory.newEndpointMetrics()); registerEndpoint(endpoint); endpoint.getLifecycleHandler().start(endpoint); ServiceContainerEndpointRegistry.register(aliasName, endpoint); endpointConsumer.accept(endpoint); }
endpoint.addAttachment(InjectionsMetaData.class, injectionsMD); endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
sepMetaData.setEndpoint(ep); ep.addAttachment(ServerEndpointMetaData.class, sepMetaData); ep.addAttachment(MessageFactoryImpl.class, messageFactory);
@Override public void start(final StartContext context) throws StartException { WSLogger.ROOT_LOGGER.starting(name); final String domainName = (String)endpoint.getProperty(SECURITY_DOMAIN_NAME); if (isElytronSecurityDomain(endpoint, domainName)) { if (EndpointType.JAXWS_EJB3.equals(endpoint.getType())) { endpoint.setSecurityDomainContext(new ElytronSecurityDomainContextImpl(this.ejbApplicationSecurityDomainValue.getValue().getSecurityDomain())); } else { endpoint.setSecurityDomainContext(new ElytronSecurityDomainContextImpl(this.elytronSecurityDomain.getValue())); } } else { endpoint.setSecurityDomainContext(new SecurityDomainContextImpl(securityDomainContextValue.getValue())); } if (EndpointType.JAXWS_EJB3.equals(endpoint.getType())) { final EJBViewMethodSecurityAttributesService ejbMethodSecurityAttributeService = ejbMethodSecurityAttributeServiceValue.getValue(); endpoint.addAttachment(EJBMethodSecurityAttributeProvider.class, new EJBMethodSecurityAttributesAdaptor(ejbMethodSecurityAttributeService)); } final List<RecordProcessor> processors = endpoint.getRecordProcessors(); for (final RecordProcessor processor : processors) { registerRecordProcessor(processor, endpoint); } final EndpointMetricsFactory factory = SPIProvider.getInstance().getSPI(EndpointMetricsFactory.class); endpoint.setEndpointMetrics(factory.newEndpointMetrics()); registerEndpoint(endpoint); endpoint.getLifecycleHandler().start(endpoint); }