org.ggf.drmaa
Class SessionFactory

java.lang.Object
  extended byorg.ggf.drmaa.SessionFactory
Direct Known Subclasses:
SessionFactoryImpl

public abstract class SessionFactory
extends java.lang.Object

This class is used to retrieve a Session instance tailored to the DRM and DRMAA implementation in use. The factory will use the org.ggf.drmaa.SessionFactory property to discover the DRM-specific Session implementation class.

Example:

public static void main(String[] args) throws Exception {
   SessionFactory factory = SessionFactory.getFactory();
   Session session = factory.getSession();

   session.init("");
   session.exit();
 }
 

Since:
0.5
Version:
1.0
Author:
dan.templeton@sun.com
See Also:
Session

Constructor Summary
SessionFactory()
           
 
Method Summary
static SessionFactory getFactory()
          Gets a SessionFactory instance appropriate for the DRM in use.
abstract  Session getSession()
          Gets a Session instance appropriate for the DRM in use.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionFactory

public SessionFactory()
Method Detail

getSession

public abstract Session getSession()
Gets a Session instance appropriate for the DRM in use.

Returns:
a Session instance appropriate for the DRM in use

getFactory

public static SessionFactory getFactory()
Gets a SessionFactory instance appropriate for the DRM in use. This method uses the org.ggf.drmaa.SessionFactory property to find the appropriate class. It looks first in the system properties. If the property is not present, the method looks in $java.home/lib/drmaa.properties. If the property still isn't found, the method will search the classpath for a META-INF/services/org.ggf.drmaa.SessionFactory resource. If the property still has not been found, the method throws an Error.

Returns:
a SessionFactory instance appropriate for the DRM in use
Throws:
java.lang.Error - if an appropriate SessionFactory implementation could not be found or instantiated


The contents of this file are licensed under the Sun Industry Standards Source License version 1.2.
Copyright 2007, Sun Microsystems, Inc.