org.jboss.dna.graph
Interface ExecutionContextFactory

All Known Implementing Classes:
BasicExecutionContextFactory

public interface ExecutionContextFactory

A factory for creating ExecutionContext instances. Each execution context is affiliated with a JAAS Subject, and thus the factory methods take the same parameters that the JAAS LoginContext take.

Author:
Randall Hauch, John Verhaeg

Method Summary
 ExecutionContext create()
          Creates an ExecutionContext using a snapshot of the access control context obtained from the current calling context.
 ExecutionContext create(AccessControlContext accessControlContext)
          Creates an ExecutionContext using the supplied access control context.
 ExecutionContext create(LoginContext loginContext)
          Create an ExecutionContext for the supplied LoginContext.
 ExecutionContext create(String name)
           
 ExecutionContext create(String name, CallbackHandler callbackHandler)
           
 ExecutionContext create(String name, Subject subject)
           
 ExecutionContext create(String name, Subject subject, CallbackHandler callbackHandler)
           
 

Method Detail

create

ExecutionContext create()
Creates an ExecutionContext using a snapshot of the access control context obtained from the current calling context.

Returns:
the execution context; never null.
See Also:
AccessController.getContext()

create

ExecutionContext create(AccessControlContext accessControlContext)
Creates an ExecutionContext using the supplied access control context.

Parameters:
accessControlContext - An access control context.
Returns:
the execution context; never null.
Throws:
IllegalArgumentException - if accessControlContext is null.

create

ExecutionContext create(LoginContext loginContext)
Create an ExecutionContext for the supplied LoginContext.

Parameters:
loginContext - the JAAS login context
Returns:
the execution context
Throws:
IllegalArgumentException - if the loginContext is null

create

ExecutionContext create(String name)
                        throws LoginException
Parameters:
name - the name of the JAAS login context
Returns:
the execution context
Throws:
IllegalArgumentException - if the name is null
LoginException - if there name is invalid (or there is no login context named "other"), or if the default callback handler JAAS property was not set or could not be loaded

create

ExecutionContext create(String name,
                        Subject subject)
                        throws LoginException
Parameters:
name - the name of the JAAS login context
subject - the subject to authenticate
Returns:
the execution context
Throws:
LoginException - if there name is invalid (or there is no login context named "other"), if the default callback handler JAAS property was not set or could not be loaded, or if the subject is null or unknown

create

ExecutionContext create(String name,
                        CallbackHandler callbackHandler)
                        throws LoginException
Parameters:
name - the name of the JAAS login context
callbackHandler - the callback handler that will be used by LoginModules to communicate with the user.
Returns:
the execution context
Throws:
LoginException - if there name is invalid (or there is no login context named "other"), or if the callbackHandler is null

create

ExecutionContext create(String name,
                        Subject subject,
                        CallbackHandler callbackHandler)
                        throws LoginException
Parameters:
name - the name of the JAAS login context
subject - the subject to authenticate
callbackHandler - the callback handler that will be used by LoginModules to communicate with the user.
Returns:
the execution context
Throws:
LoginException - if there name is invalid (or there is no login context named "other"), if the default callback handler JAAS property was not set or could not be loaded, if the subject is null or unknown, or if the callbackHandler is null


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.