Examples of ServiceConfig


Examples of org.pentaho.platform.plugin.services.pluginmgr.servicemgr.ServiceConfig

    if ( pws.getTypes() == null || pws.getTypes().length < 1 ) {
      throw new PlatformPluginRegistrationException( Messages.getInstance().getErrorString(
        "PluginManager.ERROR_0023_SERVICE_TYPE_UNSPECIFIED", pws.getId() ) ); //$NON-NLS-1$
    }
    for ( String type : pws.getTypes() ) {
      ServiceConfig ws = new ServiceConfig();

      ws.setServiceType( type );
      ws.setTitle( pws.getTitle() );
      ws.setDescription( pws.getDescription() );
      String serviceClassName =
        ( StringUtils.isEmpty( pws.getServiceClass() ) ) ? pws.getServiceBeanId() : pws.getServiceClass();

      String serviceId;
      if ( !StringUtils.isEmpty( pws.getId() ) ) {
        serviceId = pws.getId();
      } else {
        serviceId = serviceClassName;
        if ( serviceClassName.indexOf( '.' ) > 0 ) {
          serviceId = serviceClassName.substring( serviceClassName.lastIndexOf( '.' ) + 1 );
        }
      }
      ws.setId( serviceId );

      // Register the service class
      //
      final String serviceClassKey =
        ws.getServiceType() + "-" + ws.getId() + "/" + serviceClassName; //$NON-NLS-1$ //$NON-NLS-2$
      assertUnique( plugin.getId(), serviceClassKey );
      // defining plugin beans the old way through the plugin provider ifc supports only prototype scope
      BeanDefinition beanDef =
        BeanDefinitionBuilder.rootBeanDefinition( serviceClassName ).setScope( BeanDefinition.SCOPE_PROTOTYPE )
          .getBeanDefinition();
      beanFactoryMap.get( plugin.getId() ).registerBeanDefinition( serviceClassKey, beanDef );

      if ( !this.isBeanRegistered( serviceClassKey ) ) {
        throw new PlatformPluginRegistrationException( Messages.getInstance().getErrorString(
          "PluginManager.ERROR_0020_NO_SERVICE_CLASS_REGISTERED", serviceClassKey ) ); //$NON-NLS-1$
      }

      // Load/set the service class and supporting types
      //
      try {
        ws.setServiceClass( loadClass( serviceClassKey ) );

        ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
        if ( pws.getExtraClasses() != null ) {
          for ( String extraClass : pws.getExtraClasses() ) {
            classes.add( loadClass( extraClass ) );
          }
        }
        ws.setExtraClasses( classes );
      } catch ( PluginBeanException e ) {
        throw new PlatformPluginRegistrationException( Messages.getInstance().getErrorString(
          "PluginManager.ERROR_0021_SERVICE_CLASS_LOAD_FAILED", serviceClassKey ), e ); //$NON-NLS-1$
      }
      services.add( ws );
View Full Code Here

Examples of org.pentaho.platform.plugin.services.pluginmgr.servicemgr.ServiceConfig

    return null;
  }

  @Override
  public boolean setEnabled( String name, boolean enabled ) {
    ServiceConfig wrapper = (ServiceConfig) getWebServiceDefinition( name );
    wrapper.setEnabled( enabled );
    // FIXME: service is not available through the definition bean
    // AxisService axisService = wrapper.getService( );
    // axisService.setActive( enabled );
    return true;
  }
View Full Code Here

Examples of org.pentaho.platform.plugin.services.pluginmgr.servicemgr.ServiceConfig

    serviceManager.setServiceTypeManagers( Arrays.asList( gwtHandler ) );
  }

  @Test
  public void testServiceRegistration() throws ServiceException {
    ServiceConfig config = new ServiceConfig();
    config.setId( "testId" );
    config.setServiceClass( EchoServiceBean.class );
    config.setServiceType( "gwt" );
    serviceManager.registerService( config );

    assertNotNull( serviceManager.getServiceConfig( "gwt", "testId" ) );
  }
View Full Code Here

Examples of org.pentaho.platform.plugin.services.pluginmgr.servicemgr.ServiceConfig

    assertEquals( "gwt", config.getServiceType() );
  }

  @Test( expected = IllegalStateException.class )
  public void testRegisterInvalidService() throws ServiceException {
    ServiceConfig config = new ServiceConfig();
    serviceManager.registerService( config );
  }
View Full Code Here

Examples of org.tamacat.httpd.config.ServiceConfig

    HostRequestHandlerResolver hostResolver = new HostRequestHandlerResolver();
    HostServiceConfig hostConfig = new ServiceConfigParser(serverConfig).getConfig();
    for (String host : hostConfig.getHosts()) {
      HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
      ServiceConfig serviceConfig = hostConfig.getServiceConfig(host);
      for (ServiceUrl serviceUrl : serviceConfig.getServiceUrlList()) {
        HttpHandler handler = factory.getHttpHandler(serviceUrl);
        if (handler != null) {
          LOG.info(serviceUrl.getPath() + " - " + handler.getClass().getName());
          registry.register(serviceUrl.getPath() + "*", handler);
        } else {
View Full Code Here

Examples of org.tamacat.httpd.config.ServiceConfig

  ServerConfig config;
 
  @Before
  public void setUp() throws Exception {
    config = new ServerConfig();
    ServiceConfig serviceConfig  = new ServiceConfig();
   
    ServiceUrl serviceUrl = new ServiceUrl(config);
    serviceUrl.setHandlerName("ReverseHandler");
    serviceUrl.setPath("/test2/");
    serviceUrl.setType(ServiceType.REVERSE);
   
    reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/test/"));
    serviceUrl.setReverseUrl(reverseUrl);
    serviceConfig.addServiceUrl(serviceUrl);
   
    url = serviceConfig.getServiceUrl("/test2/");
    reverseUrl = url.getReverseUrl();
  }
View Full Code Here

Examples of org.tamacat.httpd.config.ServiceConfig

  ServerConfig config;
 
  @Before
  public void setUp() throws Exception {
    config = new ServerConfig();
    ServiceConfig serviceConfig = new ServiceConfig();
   
    ServiceUrl serviceUrl = new ServiceUrl(config);
    serviceUrl.setHandlerName("ReverseHandler");
    serviceUrl.setPath("/test2/");
    serviceUrl.setType(ServiceType.REVERSE);
   
    reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/test/"));
    serviceUrl.setReverseUrl(reverseUrl);
    serviceConfig.addServiceUrl(serviceUrl);

    serviceUrl = serviceConfig.getServiceUrl("/test2/");
    reverseUrl = serviceUrl.getReverseUrl();
  }
View Full Code Here

Examples of org.tamacat.httpd.config.ServiceConfig

  ServiceUrl serviceUrl;
 
  @Before
  public void setUp() throws Exception {
    serverConfig = new ServerConfig();
    serviceConfig = new ServiceConfig();
    serviceUrl = new ServiceUrl(serverConfig);
    serviceUrl.setHandlerName("DocsHandler");
    serviceUrl.setPath("/docs/");
    serviceUrl.setType(ServiceType.NORMAL);
    serviceConfig.addServiceUrl(serviceUrl);
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.