Exemplo n.º 1
0
 protected void run() {
   Object implementor = new HelloImpl();
   String address = "http://localhost:" + PORT + "/wsa/responses";
   EndpointImpl ep =
       new EndpointImpl(BusFactory.getThreadDefaultBus(), implementor, null, getWsdl());
   ep.publish(address);
 }
Exemplo n.º 2
0
 // Replaces cxf-servlet.xml
 @Bean
 // <jaxws:endpoint id="helloWorld" implementor="demo.spring.service.HelloWorldImpl"
 // address="/HelloWorld"/>
 public EndpointImpl helloWorldService(LoggingInInterceptor logIn, LoggingOutInterceptor logOut) {
   EndpointImpl endpoint = new EndpointImpl(getBus(), new HelloWorldService());
   endpoint.publish("/helloservice");
   endpoint.getServer().getEndpoint().getInInterceptors().add(logIn);
   endpoint.getServer().getEndpoint().getOutInterceptors().add(logOut);
   return endpoint;
 }
Exemplo n.º 3
0
  protected void initDefaultServant() {
    servant = new HttpNumberImpl();

    String wsdlLocation = "testutils/factory_pattern.wsdl";
    String bindingId = null;
    EndpointImpl ep =
        new EndpointImpl(BusFactory.getDefaultBus(), servant, bindingId, wsdlLocation);
    ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort"));
    ep.publish();
    templateEpr = ep.getServer().getDestination().getAddress();
  }
Exemplo n.º 4
0
  private EndpointImpl generateEndPointImpl(Class<?> cl, String endPoint) {
    Bus bus = (Bus) applicationContext.getBean(Bus.DEFAULT_BUS_ID);
    if (!bus.getInInterceptors()
        .contains(applicationContext.getBean(HeaderServiceValidator.class))) {
      bus.getInInterceptors().add(applicationContext.getBean(HeaderServiceValidator.class));
    }

    Object implementor = applicationContext.getBean(cl);
    EndpointImpl endpoint = new EndpointImpl(bus, implementor);
    endpoint.publish(endPoint);
    endpoint.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
    endpoint.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
    return endpoint;
  }
Exemplo n.º 5
0
 public static final void setBlocking(ApplicationContext ctx, EndpointImpl impl) {
   AutowireCapableBeanFactory fact = ctx.getAutowireCapableBeanFactory();
   if (fact instanceof DefaultListableBeanFactory) {
     DefaultListableBeanFactory dlbf = (DefaultListableBeanFactory) fact;
     for (BeanPostProcessor bpp : dlbf.getBeanPostProcessors()) {
       if (CommonAnnotationBeanPostProcessor.class.isInstance(bpp)) {
         impl.getServerFactory().setBlockPostConstruct(true);
         impl.getServerFactory().setBlockInjection(false);
         return;
       }
       if (bpp instanceof Jsr250BeanPostProcessor) {
         impl.getServerFactory().setBlockInjection(true);
       }
     }
   }
 }