• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Endpoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.cxf.endpoint.Endpoint的典型用法代码示例。如果您正苦于以下问题:Java Endpoint类的具体用法?Java Endpoint怎么用?Java Endpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Endpoint类属于org.apache.cxf.endpoint包,在下文中一共展示了Endpoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configureMessage2

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
@Test
public void configureMessage2() throws IllegalArgumentException {
	final UserImportEntry entry = Mockito.mock(UserImportEntry.class);
	Mockito.when(entry.getId()).thenThrow(new RuntimeException());
	final BatchTaskVo<UserImportEntry> importTask = new BatchTaskVo<>();
	importTask.setEntries(Collections.singletonList(entry));

	final Message message = Mockito.mock(Message.class);
	final UserFullLdapTask task = new UserFullLdapTask() {
		@Override
		protected Message getMessage() {
			return message;
		}

	};
	final Exchange exchange = Mockito.mock(Exchange.class);
	Mockito.when(message.getExchange()).thenReturn(exchange);
	final Endpoint endpoint = Mockito.mock(Endpoint.class);
	Mockito.when(exchange.getEndpoint()).thenReturn(endpoint);
	Mockito.when(endpoint.get("org.apache.cxf.jaxrs.provider.ServerProviderFactory")).thenReturn(ServerProviderFactory.getInstance());

	task.configure(importTask);
}
 
开发者ID:ligoj,项目名称:plugin-id,代码行数:24,代码来源:UserFullLdapTaskTest.java


示例2: setupEndpoint

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
protected void setupEndpoint(Endpoint ep) {
    resetPartTypes(ep.getBinding());

    Class<?> fmt = Source.class;
    if (ep.getBinding() instanceof SoapBinding) {
        ep.getInInterceptors().add(new SAAJInInterceptor());          
        SAAJOutInterceptor out = new SAAJOutInterceptor();
        ep.getOutInterceptors().add(out);
        ep.getOutInterceptors().add(new CxfMessageSoapHeaderOutInterceptor());
        ep.getOutInterceptors().add(new MessageModeOutInterceptor(out, ep.getBinding().getBindingInfo().getName()));
        fmt = SOAPMessage.class;
    } else {
        ep.getOutInterceptors().add(new MessageModeOutInterceptor(Source.class, ep.getBinding().getBindingInfo().getName()));
    }
    ep.getInInterceptors().add(new MessageModeInInterceptor(fmt, ep.getBinding().getBindingInfo().getName()));            
    ep.put(AbstractInDatabindingInterceptor.NO_VALIDATE_PARTS, Boolean.TRUE);
    // need to remove the wrapper class and holder interceptor
    removeInterceptors(ep.getInInterceptors(), REMOVING_IN_INTERCEPTORS);
    removeInterceptors(ep.getOutInterceptors(), REMOVING_OUT_INTERCEPTORS);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:CXFMessageDataFormatFeature.java


示例3: cleanupPreviousProps

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
private void cleanupPreviousProps(Client client) {
   Endpoint ep = client.getEndpoint();
   String[] previousProps = (String[])ep.get(JBOSSWS_CXF_CLIENT_CONF_PROPS);
   if (previousProps != null) {
      for (String p : previousProps) {
         if (Constants.CXF_IN_INTERCEPTORS_PROP.equals(p)) {
            InterceptorUtils.removeInterceptors(client.getInInterceptors(), (String)ep.get(p));
         } else if (Constants.CXF_OUT_INTERCEPTORS_PROP.equals(p)) {
            InterceptorUtils.removeInterceptors(client.getOutInterceptors(), (String)ep.get(p));
         } else if (Constants.CXF_IN_FAULT_INTERCEPTORS_PROP.equals(p)) {
            InterceptorUtils.removeInterceptors(client.getInFaultInterceptors(), (String)ep.get(p));
         } else if (Constants.CXF_OUT_FAULT_INTERCEPTORS_PROP.equals(p)) {
            InterceptorUtils.removeInterceptors(client.getOutFaultInterceptors(), (String)ep.get(p));
         } else if (Constants.CXF_FEATURES_PROP.equals(p)) {
            Loggers.ROOT_LOGGER.couldNoRemoveFeaturesOnClient((String)ep.get(p));
         }
         ep.remove(p);
      }
      ep.remove(JBOSSWS_CXF_CLIENT_CONF_PROPS);
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:22,代码来源:CXFClientConfigurer.java


示例4: handleEvent

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args)
{
   switch (ev)
   {
      case ENDPOINT_SELECTED : {
         Class<?> cls = (Class<?>) args[2];
         Class<?> implCls = (Class<?>) args[3];
         Endpoint ep = (Endpoint) args[1];
         addPolicies(factory, ep, cls, implCls);
         break;
      }
      case BINDING_OPERATION_CREATED :
         BindingOperationInfo boi = (BindingOperationInfo) args[1];
         Method m = (Method) args[2];
         addPolicies(factory, boi.getOperationInfo(), m);
         break;
      default :
         //ignore
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:21,代码来源:PolicySetsAnnotationListener.java


示例5: getTestExchange

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
private Exchange getTestExchange() {
   Exchange exchange = new ExchangeImpl();
   Message message = new MessageImpl();
   message.setExchange(exchange);
   exchange.setInMessage(message);
   exchange.put(BindingOperationInfo.class, new BindingOperationInfo());
   Service service = new ServiceImpl();
   MethodDispatcher md = new MethodDispatcher() {
      @Override
      public Method getMethod(BindingOperationInfo op) {
         return this.getClass().getMethods()[0];
      }
      @Override
      public BindingOperationInfo getBindingOperation(Method m, Endpoint endpoint) {
         return null;
      }
      @Override
      public void bind(OperationInfo o, Method... methods) {
      }
   };
   service.put(MethodDispatcher.class.getName(), md);
   exchange.put(Service.class, service);
   return exchange;
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:25,代码来源:JBossWSInvokerTest.java


示例6: convert

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
private Object[] convert(Endpoint endpoint, QName opName, Object... params) throws Exception {
	List<Object> listSoapObject = new ArrayList<Object>();
	BindingOperationInfo boi = endpoint.getEndpointInfo().getBinding().getOperation(opName); // Operation name is processOrder  
       BindingMessageInfo inputMessageInfo = null;
       if (!boi.isUnwrapped()) {
           inputMessageInfo = boi.getWrappedOperation().getInput();
       } else {
           inputMessageInfo = boi.getUnwrappedOperation().getInput();
       }
       List<MessagePartInfo> parts = inputMessageInfo.getMessageParts();
       
       int index = 0;
       for(Object obj : params){
       	MessagePartInfo partInfo = parts.get(index++);
       	Class<?> soapClass = partInfo.getTypeClass();
           Object soapObject = copytoSoapObject(obj, soapClass);
           listSoapObject.add(soapObject);
       }
       
       return listSoapObject.toArray();
}
 
开发者ID:yiyongfei,项目名称:jea,代码行数:22,代码来源:SoapClient.java


示例7: configure

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
public static final void configure(Endpoint endpoint, PortData port) {
    final Properties p = port.getProperties();
    if (p != null && p.containsKey(OPENEJB_ENDPOINT_CONFIGURATOR)) {
        final String classname = p.getProperty(OPENEJB_ENDPOINT_CONFIGURATOR);
        try {
            final EndpointConfigurator configurator = (EndpointConfigurator) Thread.currentThread().getContextClassLoader().loadClass(classname).newInstance();
            configurator.configure(endpoint, p);
        } catch (Exception e) {
            LOGGER.error("can't configure endpoint " + endpoint + " with configurator " + classname + ", using default config", e);
            if (port.isSecure()) {
                setupWSS4JChain(endpoint, p);
            }
        }
    } else {
        if (port.isSecure()) {
            setupWSS4JChain(endpoint, p);
        }
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:ConfigureCxfSecurity.java


示例8: getEndpointReference

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
public EndpointReference getEndpointReference(Element... referenceParameters) {
    org.apache.cxf.message.Message msg = getWrappedMessage();
    Endpoint ep = msg.getExchange().get(Endpoint.class);

    W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
    builder.address(ep.getEndpointInfo().getAddress());
    builder.serviceName(ep.getService().getName());
    builder.endpointName(ep.getEndpointInfo().getName());

    if (referenceParameters != null) {
        for (Element referenceParameter : referenceParameters) {
            builder.referenceParameter(referenceParameter);
        }
    }

    return builder.build();
}
 
开发者ID:apache,项目名称:tomee,代码行数:18,代码来源:EjbMessageContext.java


示例9: handleMessage

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
/**
 */
public void handleMessage(Message message) throws Fault {
    Endpoint endpoint = message.getExchange().get(Endpoint.class);
    @SuppressWarnings(value = "unchecked")
    Class<? extends com.google.protobuf.Message> messageClass = (Class) message.getExchange().get(IN_MESSAGE_CLASS);

    if (messageClass == null) {
        messageClass = (Class) endpoint
                .get(IN_MESSAGE_CLASS);
    }

    InputStream in = message.getContent(InputStream.class);

    try {
        com.google.protobuf.Message m = (com.google.protobuf.Message) messageClass.getMethod("parseFrom",
                InputStream.class).invoke(null, in);
        message.setContent(com.google.protobuf.Message.class, m);
    } catch (Exception e) {
        log.error("Failed to invoke message method from protobuffer.",e);
        throw new RuntimeException(e);
    }
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:24,代码来源:ProtobufMessageInInterceptor.java


示例10: setExchangeProperties

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
protected void setExchangeProperties(Exchange exchange, Endpoint ep) {
    if (ep != null) {
        exchange.put(Endpoint.class, ep);
        exchange.put(Service.class, ep.getService());
        if (ep.getEndpointInfo().getService() != null) {
            exchange.put(ServiceInfo.class, ep.getEndpointInfo()
                    .getService());
            exchange.put(InterfaceInfo.class, ep.getEndpointInfo()
                    .getService().getInterface());
        }
        exchange.put(Binding.class, ep.getBinding());
        exchange.put(BindingInfo.class, ep.getEndpointInfo().getBinding());
    }

    exchange.put(MessageObserver.class, this);
    exchange.put(Bus.class, getBus());
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:18,代码来源:ProtobufClient.java


示例11: setupInterceptorChain

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
protected InterceptorChain setupInterceptorChain(Exchange exchange) {
    if (outgoingInterceptorChain != null) {
        return outgoingInterceptorChain;
    }

    Endpoint endpoint = getEndpoint(exchange);

    PhaseManager pm = bus.getExtension(PhaseManager.class);
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i1 = bus.getOutInterceptors();
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i2 = endpoint.getOutInterceptors();
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i3 = getOutInterceptors();
    @SuppressWarnings("unchecked")
    List<Interceptor<? extends org.apache.cxf.message.Message>> i4 = endpoint.getBinding().getOutInterceptors();

    PhaseInterceptorChain phaseInterceptorChain = outboundChainCache.get(pm
            .getOutPhases(), i1, i2, i3, i4);
    return phaseInterceptorChain;
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:22,代码来源:ProtobufClient.java


示例12: getOutMessage

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
private Message getOutMessage(Message inMessage) {
    Exchange exchange = inMessage.getExchange();
    Message outMessage = exchange.getOutMessage();
    if (outMessage == null) {
        Endpoint endpoint = exchange.get(Endpoint.class);
        outMessage = endpoint.getBinding().createMessage();
        exchange.setOutMessage(outMessage);
    }
    outMessage.putAll(inMessage);
    return outMessage;
}
 
开发者ID:GovernIB,项目名称:sistra,代码行数:12,代码来源:BasicAuthAuthorizationInterceptor.java


示例13: configureWSSecurity

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
public static <T extends CallbackHandler> void configureWSSecurity(Object wsPort, String user, T passwordCallbackInstance)
{
	Client cxfClient = ClientProxy.getClient(wsPort);
	Endpoint cxfEndpoint = cxfClient.getEndpoint();

	Map<String, Object> outProps = new HashMap<String, Object>();
	outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);

	outProps.put(WSHandlerConstants.USER, user);
	outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
	outProps.put(WSHandlerConstants.PW_CALLBACK_REF, passwordCallbackInstance);

	WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
	cxfEndpoint.getOutInterceptors().add(wssOut);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:16,代码来源:CxfClientUtilsOld.java


示例14: handleMessage

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
public void handleMessage(Message message) throws Fault {
    Exchange ex = message.getExchange();
    
    // This test verifies that the "to" endpoint is not the from endpoint.
    Endpoint endpoint = ex.get(Endpoint.class);
    if ("http://localhost:9003/CamelContext/RouterPort".equals(endpoint.getEndpointInfo().getAddress())) {
        throw new Fault(new Exception("bad endpoint " + endpoint.getEndpointInfo().getAddress()));
    }
    
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:TestCxfFeature.java


示例15: publishContractToFilesystem

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
/**
 * Publish the contract to a file using the configured wsdl publisher
 *
 */
protected void publishContractToFilesystem()
{
   // Publish wsdl after endpoint deployment, as required by JSR-109, section 8.2
   if (wsdlPublisher != null)
   {
      Endpoint endpoint = getServer().getEndpoint();
      Service service = endpoint.getService();
      try
      {
         String wsdlLocation = getWsdlLocation();
         if (wsdlLocation == null) {
            JaxWsImplementorInfo info = new JaxWsImplementorInfo(getImplementorClass());
            wsdlLocation = info.getWsdlLocation();
         }
         updateSoapAddress();
         wsdlPublisher.publishWsdlFiles(service.getName(), wsdlLocation, this.getBus(), service.getServiceInfos());
      }
      catch (IOException ioe)
      {
         throw new RuntimeException(ioe);
      }
   }
   else
   {
      Loggers.DEPLOYMENT_LOGGER.unableToPublishContractDueToMissingPublisher(getImplementorClass());
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:32,代码来源:EndpointImpl.java


示例16: initialize

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
@Override
public void initialize(Server server, Bus bus) {
    Endpoint endpoint = server.getEndpoint();

    if (endpoint instanceof JaxWsEndpointImpl) {
        initialize(endpoint, this.soapServerHookInInterceptor, this.soapServerProcessInInterceptor, this.soapServerOutInterceptor);
    } else {
        initialize(endpoint, this.restServerHookInInterceptor, this.restServerProcessInInterceptor, this.restServerOutInterceptor);
    }
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:11,代码来源:SdcctLoggingFeature.java


示例17: setMessage

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
private MessageInfo setMessage(Message message, BindingOperationInfo operation,
                               boolean requestor, ServiceInfo si) {
    MessageInfo msgInfo = getMessageInfo(message, operation, requestor);
    message.put(MessageInfo.class, msgInfo);

    Exchange ex = message.getExchange();
    ex.put(BindingOperationInfo.class, operation);
    ex.put(OperationInfo.class, operation.getOperationInfo());
    ex.setOneWay(operation.getOperationInfo().isOneWay());

    //Set standard MessageContext properties required by JAX_WS, but not specific to JAX_WS.
    message.put(Message.WSDL_OPERATION, operation.getName());

    QName serviceQName = si.getName();
    message.put(Message.WSDL_SERVICE, serviceQName);

    QName interfaceQName = si.getInterface().getName();
    message.put(Message.WSDL_INTERFACE, interfaceQName);

    EndpointInfo endpointInfo = ex.get(Endpoint.class).getEndpointInfo();
    QName portQName = endpointInfo.getName();
    message.put(Message.WSDL_PORT, portQName);

    
    URI wsdlDescription = endpointInfo.getProperty("URI", URI.class);
    if (wsdlDescription == null) {
        String address = endpointInfo.getAddress();
        try {
            wsdlDescription = new URI(address + "?wsdl");
        } catch (URISyntaxException e) {
            //do nothing
        }
        endpointInfo.setProperty("URI", wsdlDescription);
    }
    message.put(Message.WSDL_DESCRIPTION, wsdlDescription);

    return msgInfo;
}
 
开发者ID:mprins,项目名称:muleebmsadapter,代码行数:39,代码来源:DocLiteralInInterceptor.java


示例18: main

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  	
      SpringBusFactory bf = new SpringBusFactory();
      URL busFile = HelloWorldService.class.getResource("client.xml");

      Bus bus = bf.createBus(busFile.toString());

HelloWorldService hws = new HelloWorldService();
HelloWorld port = hws.getHelloWorldPort();
port.sayHello("Ramesh Reddy..");
      
      
      JaxWsClientFactoryBean instance = new JaxWsClientFactoryBean();
      Configurer configurer = bus.getExtension(Configurer.class);
      configurer.configureBean(HelloWorldPort.toString() + ".jaxws-client.proxyFactory", instance); //$NON-NLS-1$
      
      SpringBusFactory.setDefaultBus(bus);
      SpringBusFactory.setThreadDefaultBus(bus);
      
      Service svc = Service.create(SERVICE);
      svc.addPort(HelloWorldPort, SOAPBinding.SOAP11HTTP_BINDING, "http://primary.example.com:8080/kerberos/HelloWorld");
      Dispatch<StreamSource> dispatch = svc.createDispatch(HelloWorldPort, StreamSource.class, Mode.PAYLOAD);

Client client = ((DispatchImpl)dispatch).getClient();
Endpoint ep = client.getEndpoint();
ep.putAll(instance.getProperties());
ep.getOutInterceptors().addAll(instance.getOutInterceptors());
//ep.getActiveFeatures().addAll(instance.getFeatures());
ep.getInFaultInterceptors().addAll(instance.getInFaultInterceptors());
ep.getInInterceptors().addAll(instance.getInInterceptors());
ep.getOutFaultInterceptors().addAll(instance.getOutFaultInterceptors());

dispatch.getRequestContext().putAll(instance.getProperties());

StreamSource source = new StreamSource(new StringReader("<tns:sayHello xmlns:tns=\"http://webservices.samples.jboss.org/\"><arg0 xmlns=\"\">ramesh</arg0></tns:sayHello>")); //$NON-NLS-1$
StreamSource result = dispatch.invoke(source);
source.getInputStream().close();

bus.shutdown(true);    	
  }
 
开发者ID:rareddy,项目名称:ws-security-examples,代码行数:41,代码来源:HelloWorldService.java


示例19: getOutMessage

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
/**
 * @param inMessage
 * @return Message
 */
private Message getOutMessage(Message inMessage)
{
    Exchange exchange = inMessage.getExchange();
    Message outMessage = exchange.getOutMessage();
    if (outMessage == null)
    {
        Endpoint endpoint = exchange.get(Endpoint.class);
        outMessage = endpoint.getBinding().createMessage();
        exchange.setOutMessage(outMessage);
    }
    outMessage.putAll(inMessage);

    return outMessage;
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:19,代码来源:AuthenticationHandler.java


示例20: transferWS

import org.apache.cxf.endpoint.Endpoint; //导入依赖的package包/类
protected Object[] transferWS(String methodName, Object... params) throws Exception{
Endpoint endpoint = client.getEndpoint();
      QName opName = getQName(endpoint, methodName);
      
      Object[] soapObject = convert(endpoint, opName, params);

      return client.invoke(opName, soapObject);
  }
 
开发者ID:yiyongfei,项目名称:jea,代码行数:9,代码来源:SoapClient.java



注:本文中的org.apache.cxf.endpoint.Endpoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ColumnFamilyStoreMBean类代码示例发布时间:2022-05-21
下一篇:
Java ClassFileReader类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap