Package org.apache.airavata.registry.api

Examples of org.apache.airavata.registry.api.Registry


    private static Logger log = LoggerFactory.getLogger(SchedulerImpl.class);

    public Provider schedule(InvocationContext context) throws SchedulerException {

        Registry registryService = context.getExecutionContext().getRegistryService();

        /*
         * Load Service
         */
        ServiceDescription serviceDesc = null;
        try {
            serviceDesc = registryService.getServiceDescription(context.getServiceName());
        } catch (RegistryException e2) {
            e2.printStackTrace();
        }

        if (serviceDesc == null)
            throw new SchedulerException("Service Desciption for " + context.getServiceName()
                    + " does not found on resource Catalog " + registryService);

        /*
         * Load host
         */
        HostDescription host = scheduleToHost(registryService, context.getServiceName());

        if (host == null)
            throw new SchedulerException("Host Desciption for " + context.getServiceName()
                    + " does not found on resource Catalog " + registryService);

        /*
         * Load app
         */
        ApplicationDeploymentDescription app = null;
        try {
            app = registryService.getDeploymentDescription(context.getServiceName(), host.getType().getHostName());
        } catch (RegistryException e2) {
            e2.printStackTrace();
        }

        if (app == null)
View Full Code Here


        // workflow context
        MessageContext<String> workflowContext = context.getMessageContext(WorkflowContextImpl.WORKFLOW_CONTEXT_NAME);

        // registry
        Registry registry = context.getExecutionContext().getRegistryService();

        if (outputContext != null && workflowContext != null) {

            String workflowId = workflowContext.getValue(WorkflowContextImpl.WORKFLOW_ID);
            List<ActualParameter> outputs = new ArrayList<ActualParameter>();

            for (Iterator<String> iterator = outputContext.getNames(); iterator.hasNext();) {
                String key = iterator.next();
                outputs.add(outputContext.getValue(key));
            }

            if (registry != null && DataRegistry.class.isAssignableFrom(registry.getClass())) {
                ((DataRegistry) registry).saveOutput(workflowId, outputs);
            } else {
                log.debug("Registry does not support for Data Catalog, CLass: " + registry.getClass());
            }

        } else {
            log.debug("Context is null");
        }
View Full Code Here

        String port = null;
        try {
            URL url = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
            properties.load(url.openStream());
            Map<String, String> map = new HashMap<String, String>((Map) properties);
            Registry registry = new JCRRegistry(new URI(map.get(ORG_APACHE_JACKRABBIT_REPOSITORY_URI)),map.get(JCR_CLASS),map.get(JCR_USER),map.get(JCR_PASS), map);
            String localAddress = Utils.getIpAddress(context.getAxisConfiguration());
            TransportInDescription transportInDescription = context.getAxisConfiguration().getTransportsIn()
                    .get("http");
            if (transportInDescription != null && transportInDescription.getParameter("port") != null) {
                port = (String) transportInDescription.getParameter("port").getValue();
View Full Code Here

            log.error(e.getMessage(), e);
        }
    }

    public void shutDown(ConfigurationContext configctx, AxisService service) {
        Registry registry = (JCRRegistry) configctx.getProperty(CONFIGURATION_CONTEXT_REGISTRY);
        String gfacURL = (String) configctx.getProperty(GFAC_URL);
        registry.deleteGFacDescriptor(gfacURL);
        thread.interrupt();
        try {
            thread.join();
        } catch (InterruptedException e) {
            log.info("GFacURL update thread is interrupted");
View Full Code Here

        }

        public void run() {
            try {
                while (true) {
                    Registry registry = (Registry) this.context.getProperty(CONFIGURATION_CONTEXT_REGISTRY);
                    String localAddress = (String) this.context.getProperty(GFAC_URL);
                    registry.saveGFacDescriptor(localAddress);
                    log.info("Updated the GFac URL in to Repository");
                    Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
                }
            } catch (InterruptedException e) {
                log.info("GFacURL update thread is interrupted");
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.Registry

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.