Examples of Service


Examples of org.jibx.ws.server.Service

     * @exception ServletException on message content or operational error
     * @exception IOException on error reading or writing
     */
    public void doPost(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException {
        logger.debug("Entered WsServletDelegate.doPost()");
        Service serv = null;
        XmlCodec incodec = null;
        XmlCodec outcodec = null;
        InByteBuffer inbuff = null;
        OutByteBuffer outbuff = null;
        try {
            // make sure we have a service instance
            serv = m_serviceMapper.getServiceInstance(req);
            if (serv == null) {
                rsp.sendError(HttpServletResponse.SC_NOT_FOUND);
            } else {
                MediaType intype = getMediaType(req.getContentType(), serv.getMediaTypeMapper());
                MediaType outtype = getAcceptableMediaType(req.getHeader("Accept"), intype);

                synchronized (s_codecPool) {
                    // allocated codec(s) and buffers for the input and output
                    incodec = s_codecPool.getCodec(intype);
                    if (intype.equals(outtype)) {
                        outcodec = incodec;
                    } else {
                        outcodec = s_codecPool.getCodec(outtype);
                    }
                    inbuff = (InByteBuffer) s_inBufferCache.getInstance();
                    outbuff = (OutByteBuffer) s_outBufferCache.getInstance();
                }

                // pass the processing on to the service
                InboundConnection inconn = new InboundConnection(req, incodec, inbuff);
                OutboundConnection outconn = new OutboundConnection(rsp, req.getCharacterEncoding(),
                    serv.getXmlOptions(), outcodec, outbuff);
                HttpServletOptions options = (HttpServletOptions) serv.getTransportOptions(HttpServletOptions.class);
                if (options != null) {
                    if (options.getInputStreamInterceptor() != null) {
                        inconn.setInterceptor(options.getInputStreamInterceptor());
                    }
                    if (options.getOutputStreamInterceptor() != null) {
                        outconn.setInterceptor(options.getOutputStreamInterceptor());
                    }
                }
                serv.processRequest(inconn, outconn);
            }

        } catch (WsException e) {
            logger.error("Error processing request", e);
            rsp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
        } finally {
            synchronized (s_codecPool) {

                // release all resources acquired for processing request
                if (serv != null) {
                    serv.releaseInstance();
                }
                if (incodec != null) {
                    s_codecPool.releaseCodec(incodec);
                }
                if (outcodec != null && outcodec != incodec) {
View Full Code Here

Examples of org.joseki.Service

    loader.getMapping().close();
  }

  protected ServiceRegistry createJosekiServiceRegistry() {
    ServiceRegistry services = new ServiceRegistry();
    Service service = new Service(new SPARQL(),
        D2RServer.SPARQL_SERVICE_NAME,
        new D2RQDatasetDesc(this.dataset));
    services.add(D2RServer.SPARQL_SERVICE_NAME, service);
    return services;
  }
View Full Code Here

Examples of org.jostraca.Service

  }



  public void generate( String pTemplate, String pOptions ) throws Exception {
    Service s = new Service();
    s.setTemplatePaths( ListUtil.make( new BasicTemplatePath( iDependsFolder+pTemplate ) ) );
    s.setConfigFolder( iConfigFolder );
    s.addPropertySet( Service.CONF_system,  s.loadBaseConfigFiles( new File( iConfigFolder, "system.conf" ) ) );

    PropertySet props = new PropertySet();
    props.set( Property.main_OutputFolder,      iDependsFolder );
    props.set( Property.main_WorkFolder,        iDependsFolder );
    props.set( Property.main_CodeWriterOptions, pOptions );
    s.addPropertySet( Service.CONF_cmdline, props );

    UserMessageHandler umh = new CommandLineUserMessageHandler();
    umh.setThreshold( umh.DEBUG );
    s.setUserMessageHandler( umh );
    s.build();
  }
View Full Code Here

Examples of org.jrebirth.af.core.service.Service

     */
    @SuppressWarnings("unchecked")
    private void returnData(final Wave wave) {

        // Use only the Service class to retrieve the same instance each time
        final Service service = getGlobalFacade().getServiceFacade().retrieve((Class<Service>) wave.getRelatedClass());

        if (service == null) {
            LOGGER.error(SERVICE_NOT_FOUND_ERROR, wave.toString());
            if (JRebirthParameters.DEVELOPER_MODE.get()) {
                this.unprocessedWaveHandler.manageUnprocessedWave(SERVICE_NOT_FOUND_MESSAGE.getText(), wave);
            }
        } else {
            // The inner task will be run into the JRebirth Thread Pool
            final ServiceTask<?> task = service.returnData(wave);
            if (task != null && JRebirthParameters.FOLLOW_UP_SERVICE_TASKS.get()) {
                getGlobalFacade().getServiceFacade().retrieve(TaskTrackerService.class).trackTask(task);
            }

        }
View Full Code Here

Examples of org.jrest4guice.rest.Service

    Class resourceClaz = current.getServiceClass();
    if (resourceClaz != null) {
      try {
        Object instance = GuiceContext.getInstance().getBean(
            resourceClaz);
        return new Service(instance, current.getMethod());
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

Examples of org.jvnet.hk2.annotations.Service

        if (vi != null) {
            visibility = vi.value();
        }
       
        String classAnalysisName = null;
        Service service = constant.getClass().getAnnotation(Service.class);
        if (service != null) {
            classAnalysisName = service.analyzer();
        }
       
        return new ConstantActiveDescriptor<T>(
                constant,
                contractsAsSet,
View Full Code Here

Examples of org.kie.Service

            this.bc = bc;
            this.activator = activator;
        }

        public Object addingService(ServiceReference ref) {
            Service service = (Service) this.bc.getService( ref );
            logger.info( "registering compiler : " + service + " : " + service.getClass().getInterfaces()[0] );

            Dictionary dic = new Hashtable();
            ServiceReference regServiceRef = this.activator.kbuilderReg.getReference();
            for ( String key : regServiceRef.getPropertyKeys() ) {
                dic.put( key,
                         regServiceRef.getProperty( key ) );
            }
            dic.put( service.getClass().getInterfaces()[0].getName(),
                     "true" );
            activator.kbuilderReg.setProperties( dic );

            ServiceRegistryImpl.getInstance().registerLocator( service.getClass().getInterfaces()[0],
                                                               new BundleContextInstantiator( this.bc,
                                                                                              ref ) );
            return service;
        }
View Full Code Here

Examples of org.kie.api.Service

            this.activator = activator;
            this.serviceClass = serviceClass;
        }

        public Object addingService(ServiceReference ref) {
            Service service = (Service) this.bc.getService( ref );
            logger.info( "registering compiler : " + service + " : " + service.getClass().getInterfaces()[0] );

            Dictionary dic = new Hashtable();
            ServiceReference regServiceRef = this.activator.kbuilderReg.getReference();
            for ( String key : regServiceRef.getPropertyKeys() ) {
                dic.put( key,
                         regServiceRef.getProperty( key ) );
            }
            dic.put( service.getClass().getInterfaces()[0].getName(),
                     "true" );
            activator.kbuilderReg.setProperties( dic );

            ServiceRegistryImpl.getInstance().registerLocator( serviceClass != null ? serviceClass : service.getClass().getInterfaces()[0],
                                                               new BundleContextInstantiator( this.bc,
                                                                                              ref ) );
            return service;
        }
View Full Code Here

Examples of org.mindswap.owls.service.Service

     * @see owlsmx.Matchmaker#addService(java.lang.Integer, org.mindswap.owls.service.Service)
     */
    public void addService(Integer integer, URI profileURI){    
    try {
      org.mindswap.owl.OWLOntology onto = base.read(profileURI);
      Service service = onto.getService();
      addService(integer, onto, MatchmakerUtils.getURIList(service.getProfile().getInputs()), MatchmakerUtils.getURIList(service.getProfile().getOutputs()) );
    } catch (FileNotFoundException e) {
      ErrorLog.instanceOf().report(this.getClass().toString() + "|addService: Could not add service from this URI" + profileURI.toString());
      e.printStackTrace();
    }
    base.unload(profileURI);
View Full Code Here

Examples of org.mule.api.service.Service

                assertTrue(e instanceof DispatchException);
                assertTrue(e.getCause() instanceof NoReceiverForEndpointException);
            }
        }
       
        Service c = muleContext.getRegistry().lookupService(component);
        c.start();

        MuleMessage message = client.send(endpoint, "Test Client Send message", null);
        assertNotNull(message);
        assertEquals("Received: Test Client Send message", message.getPayloadAsString());

        // The SpringRegistry is read-only so we can't unregister the service!
        //muleContext.getRegistry().unregisterComponent("vmComponent");
        c.stop();

        try
        {
            client.send(endpoint, "Test Client Send message", null);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.