Examples of ServiceManager


Examples of org.hibernate.search.engine.service.spi.ServiceManager

  }

  private ShardIdentifierProvider createShardIdentifierProvider(WorkerBuildContext buildContext, Properties indexProperty) {
    ShardIdentifierProvider shardIdentifierProvider;
    String shardIdentityProviderName = indexProperty.getProperty( SHARDING_STRATEGY );
    ServiceManager serviceManager = buildContext.getServiceManager();
    shardIdentifierProvider = ClassLoaderHelper.instanceFromName(
        ShardIdentifierProvider.class,
        shardIdentityProviderName,
        "ShardIdentifierProvider",
        serviceManager
View Full Code Here

Examples of org.hibernate.search.engine.service.spi.ServiceManager

    String defaultSimilarityClassName = searchConfiguration.getProperty( Environment.SIMILARITY_CLASS );
    if ( StringHelper.isEmpty( defaultSimilarityClassName ) ) {
      return DEFAULT_SIMILARITY;
    }
    else {
      ServiceManager serviceManager = buildContext.getServiceManager();
      return ClassLoaderHelper.instanceFromName(
          Similarity.class,
          defaultSimilarityClassName,
          "default similarity",
          serviceManager
View Full Code Here

Examples of org.hibernate.search.engine.service.spi.ServiceManager

  private Similarity getConfiguredPerIndexSimilarity(String directoryProviderName, Properties indexProperties, WorkerBuildContext buildContext) {
    Similarity configLevelSimilarity = null;
    String similarityClassName = indexProperties.getProperty( Environment.SIMILARITY_CLASS_PER_INDEX );
    if ( similarityClassName != null ) {
      ServiceManager serviceManager = buildContext.getServiceManager();
      configLevelSimilarity = ClassLoaderHelper.instanceFromName(
          Similarity.class,
          similarityClassName,
          "Similarity class for index " + directoryProviderName,
          serviceManager
View Full Code Here

Examples of org.hibernate.search.engine.service.spi.ServiceManager

      else {
        shardingStrategy = new IdHashShardingStrategy();
      }
    }
    else {
      ServiceManager serviceManager = buildContext.getServiceManager();
      shardingStrategy = ClassLoaderHelper.instanceFromName(
          IndexShardingStrategy.class,
          shardingStrategyName,
          "IndexShardingStrategy",
          serviceManager
View Full Code Here

Examples of org.hibernate.search.engine.service.spi.ServiceManager

  public static DirectoryProvider<?> createDirectoryProvider(String directoryProviderName, Properties indexProps, WorkerBuildContext context) {
    String className = indexProps.getProperty( "directory_provider", "" );
    String maybeShortCut = className.toLowerCase();

    DirectoryProvider<?> provider;
    ServiceManager serviceManager = context.getServiceManager();
    //try and use the built-in shortcuts before loading the provider as a fully qualified class name
    if ( defaultProviderClasses.containsKey( maybeShortCut ) ) {
      String fullClassName = defaultProviderClasses.get( maybeShortCut );
      provider = ClassLoaderHelper.instanceFromName(
          DirectoryProvider.class,
View Full Code Here

Examples of org.wso2.carbon.governance.api.services.ServiceManager

                                                    newResource.setContent(newContent.toString().getBytes());
//                                                    the above part is the modification of the service resource
                                                }

                                            }
                                            ServiceManager manager = new ServiceManager(requestContext.getSystemRegistry());
                                            XMLStreamReader reader = XMLInputFactory.newInstance()
                                                    .createXMLStreamReader(
                                                            new ByteArrayInputStream((byte[]) newResource.getContent()));
                                            StAXOMBuilder builder = new StAXOMBuilder(reader);
                                            OMElement serviceElement = builder.getDocumentElement();
                                            serviceElement.build();
                                            OMFactory fac = OMAbstractFactory.getOMFactory();
                                            //adding required fields at the top of the xml which will help to easily read in service side
                                            Iterator it = serviceElement.getChildrenWithLocalName("newServicePath");
                                            if (it.hasNext()) {
                                                while (it.hasNext()) {
                                                    OMElement next = (OMElement) it.next();
                                                    next.setText(resourcePath);
                                                    break;
                                                }
                                            } else {
                                                OMElement operation = fac.createOMElement("newServicePath", serviceElement.getNamespace(), serviceElement);
                                                operation.setText(resourcePath);
                                            }
//                                            this is here to override the default path
                                            serviceElement.build();
                                            newResource.setContent(new String(serviceElement.toString().getBytes()));
                                            newResource.setMediaType(org.wso2.carbon.registry.extensions.utils.CommonConstants.SERVICE_MEDIA_TYPE);
                                            Properties properties = new Properties(resource.getProperties());
                                            newResource.setProperties(properties);

                                            Service service = manager.newService(serviceElement);
                                            manager.addService(service);
                                            resourcePath = CommonUtil.computeServicePathWithVersion(resourcePath, parameterMap.get(currentResourcePath));
                                            changed = true;

                                        } else if (action.equals("Demote")) {
                                            return;
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.