Package org.lilyproject.runtime.rapi

Examples of org.lilyproject.runtime.rapi.ModuleSource$Resource


        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
        addResource(resource, "json""format=json",  mashup, "application/json");
        addResource(resource, "xml",   "format=xml",   mashup, "application/xml");
        addResource(resource, "jsonp", "format=jsonp", mashup, "application/javascript");
       
View Full Code Here


        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
        addMethod(resource.addNewMethod(), "json", mashup, "application/json");
       
        return applicationDocument.xmlText(new XmlOptions().setSavePrettyPrint());
    }
View Full Code Here

       
        return applicationDocument.xmlText(new XmlOptions().setSavePrettyPrint());
    }
   
    private static void addResource(Resource resource, String format, String path, Mashup mashup, String mediaType) {
        Resource resource3 = resource.addNewResource();
        resource3.setPath(path);
        addMethod(resource3.addNewMethod(), format, mashup, mediaType);
    }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.RESOURCE: {
            Resource resource = (Resource) theEObject;
            T result = caseResource(resource);
            if (result == null)
                result = caseRootElement(resource);
            if (result == null)
                result = caseBaseElement(resource);
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setResourceRef(Resource newResourceRef) {
        Resource oldResourceRef = resourceRef;
        resourceRef = newResourceRef;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF, oldResourceRef, resourceRef));
    }
View Full Code Here

        this.moduleDefinition = moduleDefinition;
        this.runtime = runtime;
    }

    private ModuleConfig build() {
        ModuleSource moduleSource = null;
        VersionManager versionManager = new VersionManager(runtime);
        try {
            moduleSource = runtime.getModuleSourceManager().getModuleSource(moduleDefinition.getFile(), moduleDefinition.getSourceType());

            // build classpath
            ClassLoadingConfig classLoadingConfig;
            InputStream is = moduleSource.getClassLoaderConfig();
            if (is != null) {
                try {
                    Document document = DocumentHelper.parse(is);
                    classLoadingConfig = XmlClassLoaderBuilder.build(document.getDocumentElement(), moduleSource, runtime.getArtifactRepository(), versionManager);
                } finally {
                    IOUtils.closeQuietly(is);
                }
            } else {
                ClasspathEntry selfEntry = new ClasspathEntry(new FileArtifactRef(moduleSource.getClassPathEntry()), ArtifactSharingMode.PROHIBITED, moduleSource);
                classLoadingConfig = new ClassLoadingConfigImpl(Collections.singletonList(selfEntry), runtime.getArtifactRepository());
            }

            return new ModuleConfigImpl(moduleDefinition, classLoadingConfig, moduleSource);

        } catch (Throwable e) {
            if (moduleSource != null) {
                try {
                    moduleSource.dispose();
                } catch (Throwable e2) {
                    log.error("Error disposing module source for file " + moduleDefinition.getFile().getAbsolutePath(), e2);
                }
            }
View Full Code Here

    public synchronized ModuleSource getModuleSource(File location, ModuleSourceType moduleSourceType)
            throws ModuleSourceCreationException {
        String key = getKey(location);
        SharedModuleSource moduleSource = moduleSources.get(key);
        if (moduleSource == null) {
            ModuleSource newModuleSource = createModuleSource(location, moduleSourceType);
            moduleSource = new SharedModuleSource(newModuleSource, this, key);
            moduleSources.put(key, moduleSource);
        } else {
            if (getType(moduleSource.getDelegate()) != moduleSourceType) {
                throw new LilyRTException("The same module location was requested earlier but with a different type. Type 1: " + getType(moduleSource) + ", type 2: " + moduleSourceType);
View Full Code Here

    }

    private ModuleSource createModuleSource(File location, ModuleSourceType moduleSourceType)
            throws ModuleSourceCreationException {
        try {
            ModuleSource moduleSource;
            switch (moduleSourceType) {
                case JAR:
                    moduleSource = new JarModuleSource(location);
                    break;
                case EXPANDED_JAR:
View Full Code Here

   {
      public Resource apply(V1Resource from)
      {
         if (from != null)
         {
            Resource result = WSRPTypeFactory.createResource(from.getResourceName(), WSRPUtils.transform(from.getValues(), RESOURCEVALUE));
            return result;
         }
         else
         {
            return null;
View Full Code Here

   }

   public static Resource createResource(String resourceName, List<ResourceValue> resourceValue)
   {
      ParameterValidation.throwIllegalArgExceptionIfNull(resourceName, "ResourceName");
      Resource resource = new Resource();
      resource.setResourceName(resourceName);

      if (resourceValue != null && !resourceValue.isEmpty())
      {
         resource.getValues().addAll(resourceValue);
      }

      return resource;
   }
View Full Code Here

TOP

Related Classes of org.lilyproject.runtime.rapi.ModuleSource$Resource

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.