Package org.apache.axis2.jaxws.server.endpoint.injection

Examples of org.apache.axis2.jaxws.server.endpoint.injection.ResourceInjector


     *
     */
    public static ResourceInjector createResourceInjector(Class resourceType)
        throws ResourceInjectionException {
        Object obj = FactoryRegistry.getFactory(resourceType);
        ResourceInjector injector = null;

        // make sure we have a ResourceInjector instance
        if (obj instanceof ResourceInjector) {
            injector = (ResourceInjector) obj;
        }
View Full Code Here


        return soapMessageContext;
    }

    private void injectWebServiceContext(MessageContext mc, WebServiceContext wsContext,
                                         Object serviceInstance) throws ResourceInjectionException {
        ResourceInjector ri =
                ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
        ri.inject(wsContext, serviceInstance);
    }
View Full Code Here

  public void testInjectionOnField(){
    Object serviceInstance = new ResourceInjectionTestImpl1();
        TestLogger.logger.debug("------------------------------");
        TestLogger.logger.debug("Test : " + getName());
    try{
      ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
      injector.inject(resource, serviceInstance);
      ResourceInjectionTestImpl1 serviceImpl =(ResourceInjectionTestImpl1)serviceInstance;
      assertNotNull(serviceImpl.ctx);
            TestLogger.logger.debug("Resource Injected on Field");
            TestLogger.logger.debug("------------------------------");
    }catch(Exception e){
View Full Code Here

  public void testInjectionOnMethod(){
    Object serviceInstance = new ResourceInjectionTestImpl2();
        TestLogger.logger.debug("------------------------------");
        TestLogger.logger.debug("Test : " + getName());
    try{
      ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
      injector.inject(resource, serviceInstance);
      ResourceInjectionTestImpl2 serviceImpl =(ResourceInjectionTestImpl2)serviceInstance;
      assertNotNull(serviceImpl.ctx);
            TestLogger.logger.debug("Resource Injected on Method");
            TestLogger.logger.debug("------------------------------");
    }catch(Exception e){
View Full Code Here

  public void testInjectionOnPrivateField(){
    Object serviceInstance = new ResourceInjectionTestImpl3();
        TestLogger.logger.debug("------------------------------");
        TestLogger.logger.debug("Test : " + getName());
    try{
      ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
      injector.inject(resource, serviceInstance);
      ResourceInjectionTestImpl3 serviceImpl =(ResourceInjectionTestImpl3)serviceInstance;
      assertNotNull(serviceImpl.getCtx());
            TestLogger.logger.debug("Resource Injected on Private Field");
            TestLogger.logger.debug("------------------------------");
    }catch(Exception e){
View Full Code Here

  public void testInjectionOnProvateMethod(){
    Object serviceInstance = new ResourceInjectionTestImpl4();
        TestLogger.logger.debug("------------------------------");
        TestLogger.logger.debug("Test : " + getName());
    try{
      ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
      injector.inject(resource, serviceInstance);
      ResourceInjectionTestImpl4 serviceImpl =(ResourceInjectionTestImpl4)serviceInstance;
      assertNotNull(serviceImpl.getCtx());
            TestLogger.logger.debug("Resource Injected using private Method");
            TestLogger.logger.debug("------------------------------");
    }catch(Exception e){
View Full Code Here

  public void testTypedResourceInjectionOnField(){
    Object serviceInstance = new ResourceInjectionTestImpl5();
        TestLogger.logger.debug("------------------------------");
        TestLogger.logger.debug("Test : " + getName());
    try{
      ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
      injector.inject(resource, serviceInstance);
      ResourceInjectionTestImpl5 serviceImpl =(ResourceInjectionTestImpl5)serviceInstance;
      assertNotNull(serviceImpl.ctx);
            TestLogger.logger.debug("Resource Injected on Field");
            TestLogger.logger.debug("------------------------------");
    }catch(Exception e){
View Full Code Here

            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.server.endpoint.injection.ResourceInjector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.