org.jboss.wsf.spi.deployment.Endpoint.addAttachment()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(201)

本文整理了Java中org.jboss.wsf.spi.deployment.Endpoint.addAttachment()方法的一些代码示例,展示了Endpoint.addAttachment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Endpoint.addAttachment()方法的具体详情如下:
包路径:org.jboss.wsf.spi.deployment.Endpoint
类名称:Endpoint
方法名:addAttachment

Endpoint.addAttachment介绍

暂无

代码示例

代码示例来源:origin: org.jboss.ws/jbossws-jboss501CR1

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;
}

代码示例来源:origin: org.jboss.ws/jbossws-jboss510x

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;
}

代码示例来源:origin: org.jboss.ws/jbossws-jboss600x

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;
}

代码示例来源:origin: org.jboss.ws/jbossws-jboss423

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;
}

代码示例来源:origin: org.jboss.ws/jbossws-framework

endpoint.addAttachment(BindingCustomization.class, jaxbCustomizations);

代码示例来源:origin: org.jboss.ws/jbossws-common

/**
* 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));
}

代码示例来源:origin: org.jboss.ws/jbossws-common

endpoint.addAttachment(BindingCustomization.class, jaxbCustomizations);

代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-server

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);

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

@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);
     }
   }
  }
}

代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-server

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);
  }
}

代码示例来源:origin: org.jboss.ws/jbossws-jboss510

endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
  endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);

代码示例来源:origin: org.jboss.ws/jbossws-jboss501

endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
  endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);

代码示例来源:origin: org.wildfly/wildfly-webservices-server-integration

@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);
}

代码示例来源:origin: org.jboss.ws/jbossws-jboss600M2

endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
  endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

sepMetaData.setEndpoint(ep);
ep.addAttachment(ServerEndpointMetaData.class, sepMetaData);
ep.addAttachment(MessageFactoryImpl.class, messageFactory);

代码示例来源:origin: org.jboss.eap/wildfly-webservices-server-integration

@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);
}

相关文章