Author: amilaj
Date: Mon Jul 15 15:58:41 2013
New Revision: 1503313

URL: http://svn.apache.org/r1503313
Log:
Corrected wrong source location. Adding providers for gram and unicore

Added:
    airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/
    airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/
    airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/activator/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/activator/GFacActivator.java
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/impl/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/impl/GFacServiceImpl.java
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderException.java
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderService.java
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/JobExecutionContext.java
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/GFacService.java
    
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/JobInfo.java
    airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/
    airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/
    airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/
    airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/activator/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/activator/GramProviderActivator.java
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/service/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/service/GramProvider.java
    airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/
    airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/
    airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/activator/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/activator/UnicoreProviderActivator.java
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/service/
    
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/service/UnicoreProvider.java
Removed:
    airavata/sandbox/osgi-airavata/server/gfac/framework/src/org/
Modified:
    airavata/sandbox/osgi-airavata/server/gfac/providers/gram/pom.xml
    airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/pom.xml

Added: 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/activator/GFacActivator.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/activator/GFacActivator.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/activator/GFacActivator.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/activator/GFacActivator.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,127 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.gfac.framework.activator;
+
+import org.apache.airavata.gfac.framework.impl.GFacServiceImpl;
+import org.apache.airavata.gfac.framework.provider.GFacProviderService;
+import org.apache.airavata.gfac.framework.service.GFacService;
+import org.osgi.framework.*;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/14/13
+ * Time: 12:15 PM
+ */
+
+public class GFacActivator implements BundleActivator, ServiceListener
+{
+    // Bundle's context.
+    private BundleContext bundleContext = null;
+    // The service reference being used.
+    private ServiceReference serviceReference = null;
+
+    private GFacServiceImpl gFacServiceImpl = new GFacServiceImpl();
+
+    /**
+     * Implements BundleActivator.start(). Prints
+     * a message and adds itself to the bundle context as a service
+     * listener.
+     * @param context the framework context for the bundle.
+     **/
+    public void start(BundleContext context) throws InvalidSyntaxException {
+        System.out.println("Starting to listen for service events.");
+
+        this.bundleContext = context;
+
+        context.registerService(
+                GFacService.class.getName(), gFacServiceImpl, null);
+
+
+        synchronized (this)
+        {
+            // Listen for events pertaining to dictionary services.
+            context.addServiceListener(this, "(&(objectClass=" + 
GFacProviderService.class.getName() + ")" +
+                    "(Provider=*))");
+
+            // Query for any service references matching any language.
+            ServiceReference[] refs = this.bundleContext.getServiceReferences(
+                    GFacProviderService.class.getName(), "(Provider=*)");
+
+            // If we found any dictionary services, then just get
+            // a reference to the first one so we can use it.
+            if (refs != null)
+            {
+                for(ServiceReference serviceRef : refs) {
+                    
gFacServiceImpl.addGFacProvider((String)serviceRef.getProperty("Provider"),
+                            
(GFacProviderService)this.bundleContext.getService(serviceRef));
+
+                }
+            }
+        }
+    }
+
+    /**
+     * Implements BundleActivator.stop(). Prints
+     * a message and removes itself from the bundle context as a
+     * service listener.
+     * @param context the framework context for the bundle.
+     **/
+    public void stop(BundleContext context) {
+        context.removeServiceListener(this);
+        System.out.println("Stopped listening for service events.");
+
+        // Note: It is not required that we remove the listener here,
+        // since the framework will do it automatically anyway.
+    }
+
+    /**
+     * Implements ServiceListener.serviceChanged(). Checks
+     * to see if the service we are using is leaving or tries to get
+     * a service if we need one.
+     * @param event the fired service event.
+     **/
+    public synchronized void serviceChanged(ServiceEvent event)
+    {
+        // If a dictionary service was registered, see if we
+        // need one. If so, get a reference to it.
+        if (event.getType() == ServiceEvent.REGISTERED)
+        {
+            String providerKey = (String) 
event.getServiceReference().getProperty("Provider");
+            GFacProviderService providerService
+                    = 
(GFacProviderService)this.bundleContext.getService(event.getServiceReference());
+
+            gFacServiceImpl.addGFacProvider(providerKey, providerService);
+
+        }
+        // If a dictionary service was unregistered, see if it
+        // was the one we were using. If so, unget the service
+        // and try to query to get another one.
+        else if (event.getType() == ServiceEvent.UNREGISTERING)
+        {
+            String providerKey = (String) 
event.getServiceReference().getProperty("Provider");
+
+            this.gFacServiceImpl.removeGFacProvider(providerKey);
+            this.bundleContext.ungetService(event.getServiceReference());
+
+        }
+    }
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/impl/GFacServiceImpl.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/impl/GFacServiceImpl.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/impl/GFacServiceImpl.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/impl/GFacServiceImpl.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,59 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.gfac.framework.impl;
+
+import org.apache.airavata.gfac.framework.provider.GFacProviderService;
+import org.apache.airavata.gfac.framework.service.GFacService;
+import org.apache.airavata.gfac.framework.service.JobInfo;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/14/13
+ * Time: 1:26 PM
+ */
+
+public class GFacServiceImpl implements GFacService {
+
+    private ConcurrentHashMap<String, GFacProviderService> gfacProviders
+            = new ConcurrentHashMap<String, GFacProviderService>();
+
+    public void submitJob(JobInfo jobInfo) {
+        System.out.println("Submitting job ........");
+
+        // TODO invoke in handlers
+
+        // TODO invoke provider
+
+        // TODO invoke out handlers
+
+    }
+
+    public void addGFacProvider(String name, GFacProviderService 
gFacProviderService) {
+        gfacProviders.put(name, gFacProviderService);
+    }
+
+    public void removeGFacProvider(String name) {
+        gfacProviders.remove(name);
+    }
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderException.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderException.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderException.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderException.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.gfac.framework.provider;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/14/13
+ * Time: 12:09 PM
+ */
+
+public class GFacProviderException extends Exception {
+
+    private static final long serialVersionUID = 2L;
+
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderService.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderService.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderService.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/GFacProviderService.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,87 @@
+package org.apache.airavata.gfac.framework.provider;/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+import java.util.Map;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/14/13
+ * Time: 12:05 PM
+ */
+
+/**
+ * GFacProviderService Service injected into framework.
+ */
+public interface GFacProviderService {
+
+    void initProperties(Map<String,String> properties) throws 
GFacProviderException;
+    /**
+     * Initialize environment required for invoking the execute method of the 
provider. If environment setup is
+     * done during the in handler execution, validation of environment will go 
here.
+     * @param jobExecutionContext containing job execution related information.
+     * @throws GFacProviderException in case of a error initializing the 
environment.
+     */
+    void initialize(JobExecutionContext jobExecutionContext) throws 
GFacProviderException;
+
+    /**
+     * Invoke the providers intended functionality using information and data 
in job execution context.
+     * @param jobExecutionContext containing job execution related information.
+     * @throws GFacProviderException in case of a error executing the job.
+     */
+    void execute(JobExecutionContext jobExecutionContext) throws 
GFacProviderException;
+
+    /**
+     * Cleans up the acquired resources during initialization and execution of 
the job.
+     * @param jobExecutionContext containing job execution related information.
+     * @throws GFacProviderException in case of a error cleaning resources.
+     */
+    void dispose(JobExecutionContext jobExecutionContext) throws 
GFacProviderException;
+
+    /**
+     * Cancels all jobs relevant to an experiment.
+     * @param experimentId The experiment id
+     * @param jobExecutionContext The job execution context, contains runtime 
information.
+     * @throws GFacProviderException If an error occurred while cancelling the 
job.
+     */
+    void cancelJob(String experimentId, JobExecutionContext 
jobExecutionContext) throws GFacProviderException;
+
+    /**
+     * Cancels all jobs relevant to a workflow in an experiment.
+     * @param experimentId The experiment id
+     * @param workflowId The workflow id.
+     * @param jobExecutionContext The job execution context, contains runtime 
information.
+     * @throws GFacProviderException If an error occurred while cancelling the 
job.
+     */
+    void cancelJob(String experimentId, String workflowId,
+                   JobExecutionContext jobExecutionContext) throws 
GFacProviderException;
+
+    /**
+     * Cancels the job for a given a workflow id and node id in an experiment.
+     * @param experimentId The experiment id.
+     * @param workflowId The workflow id.
+     * @param nodeId The node id.
+     * @param jobExecutionContext The job execution context relevant to cancel 
job operation.
+     * @throws GFacProviderException If an error occurred while cancelling the 
job.
+     */
+    void cancelJob(String experimentId, String workflowId, String nodeId,
+                   JobExecutionContext jobExecutionContext) throws 
GFacProviderException;
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/JobExecutionContext.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/JobExecutionContext.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/JobExecutionContext.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/provider/JobExecutionContext.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.gfac.framework.provider;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/14/13
+ * Time: 12:09 PM
+ */
+
+public class JobExecutionContext {
+
+    private static final long serialVersionUID = 3L;
+
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/GFacService.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/GFacService.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/GFacService.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/GFacService.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,35 @@
+package org.apache.airavata.gfac.framework.service;/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/14/13
+ * Time: 9:42 AM
+ */
+
+/**
+ * Service exposed by framework bundle
+ */
+public interface GFacService {
+
+    void submitJob(JobInfo jobInfo);
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/JobInfo.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/JobInfo.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/JobInfo.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/framework/src/main/java/org/apache/airavata/gfac/framework/service/JobInfo.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,55 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.gfac.framework.service;
+
+import java.io.Serializable;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/14/13
+ * Time: 10:45 AM
+ */
+
+public class JobInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String workflowId;
+
+    private String contextHeader;
+
+    public String getWorkflowId() {
+        return workflowId;
+    }
+
+    public void setWorkflowId(String workflowId) {
+        this.workflowId = workflowId;
+    }
+
+    public String getContextHeader() {
+        return contextHeader;
+    }
+
+    public void setContextHeader(String contextHeader) {
+        this.contextHeader = contextHeader;
+    }
+}

Modified: airavata/sandbox/osgi-airavata/server/gfac/providers/gram/pom.xml
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/providers/gram/pom.xml?rev=1503313&r1=1503312&r2=1503313&view=diff
==============================================================================
--- airavata/sandbox/osgi-airavata/server/gfac/providers/gram/pom.xml (original)
+++ airavata/sandbox/osgi-airavata/server/gfac/providers/gram/pom.xml Mon Jul 
15 15:58:41 2013
@@ -22,29 +22,55 @@
       <artifactId>org.osgi.core</artifactId>
       <version>1.0.0</version>
     </dependency>
-    <!--dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>0.9.0-incubator-SNAPSHOT</version>
-    </dependency-->
+    <dependency>
+      <groupId>org.apache.osgi.airavata</groupId>
+      <artifactId>gfac-framework</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-       <version>2.4.0</version>
-        <!--configuration>
-          <instructions>
-            <Export-Package>org.osgi.service.log</Export-Package>
-            <Private-Package>org.apache.felix.log.impl</Private-Package>
-            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-            
<Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator>
-            
<Export-Service>org.osgi.service.log.LogService,org.osgi.service.log.LogReaderService</Export-Service>
-          </instructions>
-        </configuration-->
-      </plugin>
-    </plugins>
-  </build>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>${surefire.version}</version>
+                <configuration>
+                    <failIfNoTests>false</failIfNoTests>
+                    <skipTests>${skipTests}</skipTests>
+                    
<workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <version>2.4.0</version>
+                <configuration>
+                    <instructions>
+                        <Export-Package>
+                            org.apache.server.gfac.providers.gram.activator
+                        </Export-Package>
+                        <Import-Package>
+                            org.apache.airavata.gfac.framework.provider
+                        </Import-Package>
+                        
<Private-Package>org.apache.server.gfac.providers.gram.service</Private-Package>
+                        
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        
<Bundle-Activator>org.apache.server.gfac.providers.gram.activator.GramProviderActivator</Bundle-Activator>
+                        <Export-Service>
+                            
org.apache.airavata.gfac.framework.provider.GFacProviderService
+                        </Export-Service>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

Added: 
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/activator/GramProviderActivator.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/activator/GramProviderActivator.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/activator/GramProviderActivator.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/activator/GramProviderActivator.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,56 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.server.gfac.providers.gram.activator;
+
+import org.apache.airavata.gfac.framework.provider.GFacProviderService;
+import org.apache.server.gfac.providers.gram.service.GramProvider;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import java.util.Hashtable;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/15/13
+ * Time: 10:14 AM
+ */
+
+/**
+ * Gram provider activator.
+ */
+public class GramProviderActivator implements BundleActivator {
+
+    public void start(BundleContext bundleContext) throws Exception {
+
+        Hashtable<String, String> properties = new Hashtable<String, String>();
+        properties.put("Provider", "Gram");
+
+        bundleContext.registerService(
+                GFacProviderService.class.getName(), new GramProvider(), 
properties);
+
+
+    }
+
+    public void stop(BundleContext bundleContext) throws Exception {
+        //To change body of implemented methods use File | Settings | File 
Templates.
+    }
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/service/GramProvider.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/service/GramProvider.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/service/GramProvider.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/providers/gram/src/main/java/org/apache/server/gfac/providers/gram/service/GramProvider.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.server.gfac.providers.gram.service;
+
+import org.apache.airavata.gfac.framework.provider.GFacProviderException;
+import org.apache.airavata.gfac.framework.provider.GFacProviderService;
+import org.apache.airavata.gfac.framework.provider.JobExecutionContext;
+
+import java.util.Map;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/15/13
+ * Time: 9:52 AM
+ */
+
+public class GramProvider implements GFacProviderService {
+
+    public void initProperties(Map<String, String> properties) throws 
GFacProviderException {
+        System.out.println("In Gram initProp");
+    }
+
+    public void initialize(JobExecutionContext jobExecutionContext) throws 
GFacProviderException {
+        System.out.println("In Gram init");
+    }
+
+    public void execute(JobExecutionContext jobExecutionContext) throws 
GFacProviderException {
+        System.out.println("In gram execute");
+    }
+
+    public void dispose(JobExecutionContext jobExecutionContext) throws 
GFacProviderException {
+        System.out.println("In gram dispose");
+    }
+
+    public void cancelJob(String experimentId, JobExecutionContext 
jobExecutionContext) throws GFacProviderException {
+        System.out.println("In gram cancel");
+    }
+
+    public void cancelJob(String experimentId, String workflowId, 
JobExecutionContext jobExecutionContext) throws GFacProviderException {
+        System.out.println("In gram cancel");
+    }
+
+    public void cancelJob(String experimentId, String workflowId, String 
nodeId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
+        System.out.println("In gram cancel");
+    }
+}

Modified: airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/pom.xml
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/pom.xml?rev=1503313&r1=1503312&r2=1503313&view=diff
==============================================================================
--- airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/pom.xml 
(original)
+++ airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/pom.xml Mon 
Jul 15 15:58:41 2013
@@ -1,50 +1,75 @@
 <project>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.osgi.airavata</groupId>
-  <artifactId>gfac-provider-unicore</artifactId>
-  <packaging>bundle</packaging>
-  <name>Apache Airavata GFac Framework Provider Unicore</name>
-  <version>0.1-SNAPSHOT</version>
-  <description>
-    This bundle provides an implemention for GFac framework - Provider Unicore
-  </description>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.osgi.airavata</groupId>
+    <artifactId>gfac-provider-unicore</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Airavata GFac Framework Provider Unicore</name>
+    <version>0.1-SNAPSHOT</version>
+    <description>
+        This bundle provides an implemention for GFac framework - Provider 
Unicore
+    </description>
 
-  <parent>
-       <groupId>org.apache.airavata</groupId>
+    <parent>
+        <groupId>org.apache.airavata</groupId>
         <artifactId>gfac-provider-parent</artifactId>
         <version>0.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
-   </parent>
+    </parent>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.osgi.core</artifactId>
-      <version>1.0.0</version>
-    </dependency>
-    <!--dependency>
-      <groupId>${pom.groupId}</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>0.9.0-incubator-SNAPSHOT</version>
-    </dependency-->
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-       <version>2.4.0</version>
-        <!--configuration>
-          <instructions>
-            <Export-Package>org.osgi.service.log</Export-Package>
-            <Private-Package>org.apache.felix.log.impl</Private-Package>
-            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-            
<Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator>
-            
<Export-Service>org.osgi.service.log.LogService,org.osgi.service.log.LogReaderService</Export-Service>
-          </instructions>
-        </configuration-->
-      </plugin>
-    </plugins>
-  </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.osgi.airavata</groupId>
+            <artifactId>gfac-framework</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!--dependency>
+          <groupId>${pom.groupId}</groupId>
+          <artifactId>org.osgi.compendium</artifactId>
+          <version>0.9.0-incubator-SNAPSHOT</version>
+        </dependency-->
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>${surefire.version}</version>
+                <configuration>
+                    <failIfNoTests>false</failIfNoTests>
+                    <skipTests>${skipTests}</skipTests>
+                    
<workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <version>2.4.0</version>
+                <configuration>
+                    <instructions>
+                        
<Export-Package>org.apache.server.gfac.providers.unicore.activator</Export-Package>
+                        
<Private-Package>org.apache.server.gfac.providers.unicore.service</Private-Package>
+                        
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        
<Bundle-Activator>org.apache.server.gfac.providers.unicore.activator.UnicoreProviderActivator
+                        </Bundle-Activator>
+                        
<Export-Service>org.apache.airavata.gfac.framework.provider.GFacProviderService</Export-Service>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

Added: 
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/activator/UnicoreProviderActivator.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/activator/UnicoreProviderActivator.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/activator/UnicoreProviderActivator.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/activator/UnicoreProviderActivator.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,51 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.server.gfac.providers.unicore.activator;
+
+import org.apache.airavata.gfac.framework.provider.GFacProviderService;
+import org.apache.server.gfac.providers.unicore.service.UnicoreProvider;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import java.util.Hashtable;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/15/13
+ * Time: 10:27 AM
+ */
+
+public class UnicoreProviderActivator implements BundleActivator {
+
+    public void start(BundleContext bundleContext) throws Exception {
+        Hashtable<String, String> properties = new Hashtable<String, String>();
+        properties.put("Provider", "Unicore");
+
+        bundleContext.registerService(
+                GFacProviderService.class.getName(), new UnicoreProvider(), 
properties);
+
+    }
+
+    public void stop(BundleContext bundleContext) throws Exception {
+        //To change body of implemented methods use File | Settings | File 
Templates.
+    }
+}

Added: 
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/service/UnicoreProvider.java
URL: 
http://svn.apache.org/viewvc/airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/service/UnicoreProvider.java?rev=1503313&view=auto
==============================================================================
--- 
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/service/UnicoreProvider.java
 (added)
+++ 
airavata/sandbox/osgi-airavata/server/gfac/providers/unicore/src/main/java/org/apache/server/gfac/providers/unicore/service/UnicoreProvider.java
 Mon Jul 15 15:58:41 2013
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.server.gfac.providers.unicore.service;
+
+import org.apache.airavata.gfac.framework.provider.GFacProviderException;
+import org.apache.airavata.gfac.framework.provider.GFacProviderService;
+import org.apache.airavata.gfac.framework.provider.JobExecutionContext;
+
+import java.util.Map;
+
+/**
+ * User: AmilaJ ([email protected])
+ * Date: 7/15/13
+ * Time: 10:25 AM
+ */
+
+public class UnicoreProvider implements GFacProviderService {
+
+    public void initProperties(Map<String, String> properties) throws 
GFacProviderException {
+        System.out.println("In Unicore initProp");
+    }
+
+    public void initialize(JobExecutionContext jobExecutionContext) throws 
GFacProviderException {
+        System.out.println("In Unicore init");
+    }
+
+    public void execute(JobExecutionContext jobExecutionContext) throws 
GFacProviderException {
+        System.out.println("In Unicore execute");
+    }
+
+    public void dispose(JobExecutionContext jobExecutionContext) throws 
GFacProviderException {
+        System.out.println("In Unicore dispose");
+    }
+
+    public void cancelJob(String experimentId, JobExecutionContext 
jobExecutionContext) throws GFacProviderException {
+        System.out.println("In Unicore cancel");
+    }
+
+    public void cancelJob(String experimentId, String workflowId, 
JobExecutionContext jobExecutionContext) throws GFacProviderException {
+        System.out.println("In Unicore cancel");
+    }
+
+    public void cancelJob(String experimentId, String workflowId, String 
nodeId, JobExecutionContext jobExecutionContext) throws GFacProviderException {
+        System.out.println("In Unicore cancel");
+    }
+}


Reply via email to