net.officefloor.plugin.jndi.work
Class JndiWorkSource

java.lang.Object
  extended by net.officefloor.compile.spi.work.source.impl.AbstractWorkSource<JndiWork>
      extended by net.officefloor.plugin.jndi.work.JndiWorkSource
All Implemented Interfaces:
WorkSource<JndiWork>

public class JndiWorkSource
extends AbstractWorkSource<JndiWork>

WorkSource to execute Method instances on a JNDI Object.

Author:
Daniel Sagenschneider

Nested Class Summary
 
Nested classes/interfaces inherited from class net.officefloor.compile.spi.work.source.impl.AbstractWorkSource
AbstractWorkSource.SpecificationContext
 
Field Summary
static String PROPERTY_FACADE_CLASS
           Name of property containing the fully qualified class of the facade.
static String PROPERTY_JNDI_NAME
          Name of property containing the JNDI name of the Object that is to be the functionality of the Work.
static String PROPERTY_WORK_TYPE
          Name of property containing the fully qualified type of the expected JNDI Object.
 
Constructor Summary
JndiWorkSource()
           
 
Method Summary
protected  void loadSpecification(AbstractWorkSource.SpecificationContext context)
          Loads the WorkSourceSpecification.
 void sourceWork(WorkTypeBuilder<JndiWork> workTypeBuilder, WorkSourceContext context)
          Sources the WorkType by populating it via the input WorkTypeBuilder.
 
Methods inherited from class net.officefloor.compile.spi.work.source.impl.AbstractWorkSource
getSpecification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_JNDI_NAME

public static final String PROPERTY_JNDI_NAME
Name of property containing the JNDI name of the Object that is to be the functionality of the Work.

See Also:
Constant Field Values

PROPERTY_WORK_TYPE

public static final String PROPERTY_WORK_TYPE
Name of property containing the fully qualified type of the expected JNDI Object.

See Also:
Constant Field Values

PROPERTY_FACADE_CLASS

public static final String PROPERTY_FACADE_CLASS

Name of property containing the fully qualified class of the facade.

To simplify using JNDI objects as Work, a facade can be optionally used to simplify the JNDI object methods for configuring into OfficeFloor.

Only Method instances of the facade that have a parameter as per PROPERTY_WORK_TYPE are included. The JNDI Object will however not appear as a TaskObjectType, as it will be provided from the Work.

Should the facade have a Method of the same name as a Method of the JNDI Object, the facade method will overwrite the JNDI Object Method.

The facade allows for example to:

  1. Manipulating the parameter of the Task to the JNDI Object Method parameters
  2. Changing the type/order of parameters to the JNDI Object Method
  3. Invoking the JNDI Object Method instances multiple times to process lists

See Also:
Constant Field Values
Constructor Detail

JndiWorkSource

public JndiWorkSource()
Method Detail

loadSpecification

protected void loadSpecification(AbstractWorkSource.SpecificationContext context)
Description copied from class: AbstractWorkSource
Loads the WorkSourceSpecification.

Specified by:
loadSpecification in class AbstractWorkSource<JndiWork>
Parameters:
context - AbstractWorkSource.SpecificationContext.

sourceWork

public void sourceWork(WorkTypeBuilder<JndiWork> workTypeBuilder,
                       WorkSourceContext context)
                throws Exception
Description copied from interface: WorkSource
Sources the WorkType by populating it via the input WorkTypeBuilder.

Parameters:
workTypeBuilder - WorkTypeBuilder to be populated with the type definition of the Work.
context - WorkSourceContext to source details to populate the WorkTypeBuilder.
Throws:
Exception - If fails to populate the WorkTypeBuilder.


Copyright © 2005-2013. All Rights Reserved.