Package org.apache.uima.resource.metadata

Examples of org.apache.uima.resource.metadata.ResourceMetaData


          throws Exception {
    OperationalProperties op = null;
    // Parse the descriptor to access Operational Properties
    ResourceSpecifier resourceSpecifier = cpeFactory.getSpecifier(new File(aDescPath).toURL());
    if (resourceSpecifier != null && resourceSpecifier instanceof ResourceCreationSpecifier) {
      ResourceMetaData md = ((ResourceCreationSpecifier) resourceSpecifier).getMetaData();
      if (md instanceof ProcessingResourceMetaData) {
        op = ((ProcessingResourceMetaData) md).getOperationalProperties();
        if (op == null) {
          // Operational Properties not defined, so use defaults
          if (isConsumer) {
View Full Code Here


            else
              throw new RuntimeException(e);
          }
        }
        if (resource != null) {
          ResourceMetaData metadata = resource.getMetaData();
          if (metadata instanceof ProcessingResourceMetaData) {
            mdList.add(metadata);
          }
          resource.destroy();
        }
View Full Code Here

      // Normalize language codes. Need to do this since a wide variety of
      // spellings are acceptable according to ISO.
      normalizeIsoLangCodes(md);

      // clone this metadata and assign a UUID if not already present
      ResourceMetaData mdCopy = (ResourceMetaData) md.clone();

      if (mdCopy.getUUID() == null) {
        mdCopy.setUUID(UUIDGenerator.generate());
      }
      setMetaData(mdCopy);

      // validate the AnalysisEngineDescription and throw a
      // ResourceInitializationException if there is a problem
View Full Code Here

  public ResourceMetaData callGetMetaData() throws ResourceServiceException {
    // metadata already retrieved during initialization
    try {
      //return uimaEEEngine.getMetaData();
     
      ResourceMetaData  rmd = uimaEEEngine.getMetaData();
      if ( rmd != null ) {
        ((ProcessingResourceMetaData)rmd).getOperationalProperties().setMultipleDeploymentAllowed(true);
        return rmd;
      }
     
View Full Code Here

        endpoint.cancelTimer();
        boolean collocatedAggregate = false;
        if ( endpoint.getServiceInfo() != null ) {
          endpoint.getServiceInfo().setState(ServiceState.RUNNING.name());
        }
        ResourceMetaData resource = null;
        ServiceInfo remoteDelegateServiceInfo = null;
        if (aTypeSystem.trim().length() > 0) {
          if (endpoint.isRemote()) {
            if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.CONFIG)) {
              UIMAFramework.getLogger(CLASS_NAME).logrb(Level.CONFIG, CLASS_NAME.getName(),
View Full Code Here

    // if this is a local resource (instantiated from a ResourceCreationSpecifier),
    // initialize the ResourceManager and UIMA Context.
    if (aSpecifier instanceof ResourceCreationSpecifier) {
      // resolve imports in the metadata
      ResourceMetaData metadata = ((ResourceCreationSpecifier) aSpecifier).getMetaData();
      name = metadata.getName();
      try {
        metadata.resolveImports(getResourceManager());
      } catch (InvalidXMLException e) {
        throw new ResourceInitializationException(e);
      }
      // store Resource metadata so it can be retrieved via getMetaData() method
      setMetaData(metadata);
     
      // Check if a Settings object for the external overrides has been provided in the additional
      // parameters map.  If not and not already set from the parent UimaContext then create one
      // (for the root context) from the system defaults
      Settings externalOverrides = aAdditionalParams == null ? null :
                    (Settings) aAdditionalParams.get(Resource.PARAM_EXTERNAL_OVERRIDE_SETTINGS);
      if (externalOverrides != null) {
        mUimaContextAdmin.setExternalOverrides(externalOverrides);
      } else {
        if (mUimaContextAdmin.getExternalOverrides() == null) {
          externalOverrides = new Settings_impl();
          try {
            externalOverrides.loadSystemDefaults();
          } catch (ResourceConfigurationException e) {
            throw new ResourceInitializationException(ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR,
                    new Object[] { name, metadata.getSourceUrlString() }, e);
          }
          mUimaContextAdmin.setExternalOverrides(externalOverrides);
        }
      }

      // initialize configuration
      try {
        mUimaContextAdmin.getConfigurationManager().createContext(
                mUimaContextAdmin.getQualifiedContextName(), getMetaData(), mUimaContextAdmin.getExternalOverrides());
        mUimaContextAdmin.getConfigurationManager().setSession(mUimaContextAdmin.getSession());
      } catch (ResourceConfigurationException e) {
        throw new ResourceInitializationException(
                ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR, new Object[] {
                    name, metadata.getSourceUrlString() }, e);
      }

      // initialize any external resource declared in this descriptor
      ResourceManagerConfiguration resMgrCfg = ((ResourceCreationSpecifier) aSpecifier)
              .getResourceManagerConfiguration();
View Full Code Here

  public ResourceMetaData callGetMetaData() throws ResourceServiceException {
    // metadata already retrieved during initialization
    try {
      //return uimaEEEngine.getMetaData();
     
      ResourceMetaData  rmd = uimaEEEngine.getMetaData();
      if ( rmd != null ) {
        ((ProcessingResourceMetaData)rmd).getOperationalProperties().setMultipleDeploymentAllowed(true);
        return rmd;
      }
     
View Full Code Here

        endpoint.cancelTimer();
        boolean collocatedAggregate = false;
        if ( endpoint.getServiceInfo() != null ) {
          endpoint.getServiceInfo().setState(ServiceState.RUNNING.name());
        }
        ResourceMetaData resource = null;
        ServiceInfo remoteDelegateServiceInfo = null;
        if (aTypeSystem.trim().length() > 0) {
          if (endpoint.isRemote()) {
            System.out.println("Remote Service:" + key
                    + " Initialized. Ready To Process Messages From Queue:"
View Full Code Here

      else if ( endpoint.isWaitingForResponse())
      {
        endpoint.setWaitingForResponse(false);
        endpoint.cancelTimer();
        boolean collocatedAggregate = false;
        ResourceMetaData resource = null;
        if (aTypeSystem.trim().length() > 0)
        {
          if ( endpoint.isRemote() )
          {
            System.out.println(key+" Remote Service Registered Successfully");
View Full Code Here

          throws Exception {
    OperationalProperties op = null;
    // Parse the descriptor to access Operational Properties
    ResourceSpecifier resourceSpecifier = cpeFactory.getSpecifier(new File(aDescPath).toURL());
    if (resourceSpecifier != null && resourceSpecifier instanceof ResourceCreationSpecifier) {
      ResourceMetaData md = ((ResourceCreationSpecifier) resourceSpecifier).getMetaData();
      if (md instanceof ProcessingResourceMetaData) {
        op = ((ProcessingResourceMetaData) md).getOperationalProperties();
        if (op == null) {
          // Operational Properties not defined, so use defaults
          if (isConsumer) {
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.metadata.ResourceMetaData

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.