Package org.ggf.drmaa

# Class SessionFactory

java.lang.Object
org.ggf.drmaa.SessionFactory

Direct Known Subclasses:
  `SessionFactoryImpl`

public abstract class SessionFactory extends 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
See Also:
  - `Session`

## Constructor Summary

Constructors
Constructor
Description
`SessionFactory()`

## Method Summary

Modifier and Type
Method
Description
`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 Details

### SessionFactory

public SessionFactory()

## Method Details

### 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:
  `Error` - if an appropriate SessionFactory implementation could not be found or instantiated