Package org.apache.airavata.gfac.core.handler

Examples of org.apache.airavata.gfac.core.handler.ThreadedHandler


    public void delegateToMonitorHandlers(JobExecutionContext jobExecutionContext, GsisshHostType host, String jobID) throws GFacHandlerException {
        List<ThreadedHandler> daemonHandlers = GFacImpl.getDaemonHandlers();
        if (daemonHandlers == null) {
            daemonHandlers = BetterGfacImpl.getDaemonHandlers();
        }
        ThreadedHandler pullMonitorHandler = null;
        ThreadedHandler pushMonitorHandler = null;
        String monitorMode = ((GsisshHostType) host).getMonitorMode();
        for (ThreadedHandler threadedHandler : daemonHandlers) {
            if ("org.apache.airavata.gfac.monitor.handlers.GridPullMonitorHandler".equals(threadedHandler.getClass().getName())) {
                pullMonitorHandler = threadedHandler;
                if ("".equals(monitorMode) || monitorMode == null || org.apache.airavata.common.utils.Constants.PULL.equals(monitorMode)) {
                    log.info("Job is launched successfully now parsing it to monitoring in pull mode, JobID Returned:  " + jobID);
                    pullMonitorHandler.invoke(jobExecutionContext);
                } else {
                    log.error("Currently we only support Pull and Push monitoring and monitorMode should be PULL" +
                            " to handle by the GridPullMonitorHandler");
                }
            } else if ("org.apache.airavata.gfac.monitor.handlers.GridPushMonitorHandler".equals(threadedHandler.getClass().getName())) {
                pushMonitorHandler = threadedHandler;
                if ("".equals(monitorMode) || monitorMode == null || org.apache.airavata.common.utils.Constants.PUSH.equals(monitorMode)) {
                    log.info("Job is launched successfully now parsing it to monitoring in push mode, JobID Returned:  " + jobID);
                    pushMonitorHandler.invoke(jobExecutionContext);
                } else {
                    log.error("Currently we only support Pull and Push monitoring and monitorMode should be PUSH" +
                            " to handle by the GridPushMonitorHandler");
                }
            }
View Full Code Here


        for(GFacHandlerConfig handlerConfig:daemonHandlerConfig){
            String className = handlerConfig.getClassName();
            try {
                Class<?> aClass = Class.forName(className).asSubclass(ThreadedHandler.class);
                ThreadedHandler threadedHandler = (ThreadedHandler) aClass.newInstance();
                threadedHandler.initProperties(handlerConfig.getProperties());
                daemonHandlers.add(threadedHandler);
            }catch (ClassNotFoundException e){
                log.error("Error initializing the handler: " + className);
                log.error(className + " class has to implement " + ThreadedHandler.class);
            } catch (InstantiationException e) {
View Full Code Here

    public void delegateToMonitorHandlers(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
        List<ThreadedHandler> daemonHandlers = BetterGfacImpl.getDaemonHandlers();
        if (daemonHandlers == null) {
            daemonHandlers = BetterGfacImpl.getDaemonHandlers();
        }
        ThreadedHandler pullMonitorHandler = null;
        ThreadedHandler pushMonitorHandler = null;
        for (ThreadedHandler threadedHandler : daemonHandlers) {
            if ("org.apache.airavata.gfac.monitor.handlers.GridPullMonitorHandler".equals(threadedHandler.getClass().getName())) {
                pullMonitorHandler = threadedHandler;
                pullMonitorHandler.invoke(jobExecutionContext);
            }
View Full Code Here

        for (GFacHandlerConfig handlerConfig : daemonHandlerConfig) {
            String className = handlerConfig.getClassName();
            try {
                Class<?> aClass = Class.forName(className).asSubclass(ThreadedHandler.class);
                ThreadedHandler threadedHandler = (ThreadedHandler) aClass.newInstance();
                threadedHandler.initProperties(handlerConfig.getProperties());
                daemonHandlers.add(threadedHandler);
            } catch (ClassNotFoundException e) {
                log.error("Error initializing the handler: " + className);
                log.error(className + " class has to implement " + ThreadedHandler.class);
            } catch (InstantiationException e) {
View Full Code Here


            // Now job has submitted to the resource, its up to the Provider to parse the information to daemon handler
            // to perform monitoring, daemon handlers can be accessed from anywhere
            List<ThreadedHandler> daemonHandlers = GFacImpl.getDaemonHandlers();
            ThreadedHandler pullMonitorHandler = null;
            ThreadedHandler pushMonitorHandler = null;
            String monitorMode = ((GsisshHostType) host).getMonitorMode();
            for(ThreadedHandler threadedHandler:daemonHandlers){
                if("org.apache.airavata.gfac.monitor.handlers.GridPullMonitorHandler".equals(threadedHandler.getClass().getName())){
                    pullMonitorHandler = threadedHandler;
                    if("".equals(monitorMode) || monitorMode == null || org.apache.airavata.common.utils.Constants.PULL.equals(monitorMode)){
                        log.info("Job is launched successfully now parsing it to monitoring in pull mode, JobID Returned:  " + jobID);
                        pullMonitorHandler.invoke(jobExecutionContext);
                    }else{
                        log.error("Currently we only support Pull and Push monitoring and monitorMode should be PULL" +
                                " to handle by the GridPullMonitorHandler");
                    }
                }else if ("org.apache.airavata.gfac.monitor.handlers.GridPushMonitorHandler".equals(threadedHandler.getClass().getName())){
                    pushMonitorHandler = threadedHandler;
                    if("".equals(monitorMode) || monitorMode == null || org.apache.airavata.common.utils.Constants.PUSH.equals(monitorMode)){
                        log.info("Job is launched successfully now parsing it to monitoring in push mode, JobID Returned:  " + jobID);
                        pushMonitorHandler.invoke(jobExecutionContext);
                    }else{
                        log.error("Currently we only support Pull and Push monitoring and monitorMode should be PUSH" +
                                " to handle by the GridPushMonitorHandler");
                    }
                }
View Full Code Here

        for(GFacHandlerConfig handlerConfig:daemonHandlerConfig){
            String className = handlerConfig.getClassName();
            try {
                Class<?> aClass = Class.forName(className).asSubclass(ThreadedHandler.class);
                ThreadedHandler threadedHandler = (ThreadedHandler) aClass.newInstance();
                threadedHandler.initProperties(handlerConfig.getProperties());
                daemonHandlers.add(threadedHandler);
            }catch (ClassNotFoundException e){
                log.error("Error initializing the handler: " + className);
                log.error(className + " class has to implement " + ThreadedHandler.class);
            } catch (InstantiationException e) {
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.core.handler.ThreadedHandler

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.