org.gcube.common.core.contexts
Class LocalInstanceContext

java.lang.Object
  extended by org.gcube.common.core.contexts.LocalInstanceContext

public class LocalInstanceContext
extends Object


Method Summary
 Collection<GCUBERunningInstance> getAllInstances()
          Gets all the instances registered in this context
 List<GCUBERunningInstance> getAllInstancesForPlatform(PlatformDescription platform)
          Gets all the instances belonging to the platform
static LocalInstanceContext getContext()
           
 GCUBERunningInstance getInstance(String id)
          Gets the registered instance given its ID
 GCUBERunningInstance getInstance(String clazz, String name)
          Gets a registered instance
 void registerInstance(GCUBERunningInstance instance)
          Registers the instance in the context
 void unregisterInstance(GCUBERunningInstance instance)
          Unregisters the instance from the context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContext

public static LocalInstanceContext getContext()
Returns:
the local context

registerInstance

public void registerInstance(GCUBERunningInstance instance)
                      throws Exception
Registers the instance in the context

Parameters:
instance -
Throws:
Exception

unregisterInstance

public void unregisterInstance(GCUBERunningInstance instance)
Unregisters the instance from the context

Parameters:
instance -

getInstance

public GCUBERunningInstance getInstance(String id)
                                 throws Exception
Gets the registered instance given its ID

Parameters:
id -
Returns:
Throws:
Exception

getInstance

public GCUBERunningInstance getInstance(String clazz,
                                        String name)
                                 throws Exception
Gets a registered instance

Parameters:
clazz - the class of the instance
name - the name of the instance
Returns:
the instance
Throws:
Exception

getAllInstances

public Collection<GCUBERunningInstance> getAllInstances()
Gets all the instances registered in this context

Returns:
the instances

getAllInstancesForPlatform

public List<GCUBERunningInstance> getAllInstancesForPlatform(PlatformDescription platform)
Gets all the instances belonging to the platform

Parameters:
platform - the filtering platform
Returns:
the instances


Copyright © 2013. All Rights Reserved.