Class ServletProcedureSource
- java.lang.Object
-
- net.officefloor.servlet.procedure.ServletProcedureSource
-
- All Implemented Interfaces:
ManagedFunctionProcedureSource
,ProcedureSource
,ProcedureSourceServiceFactory
,ServiceFactory<ProcedureSource>
public class ServletProcedureSource extends java.lang.Object implements ManagedFunctionProcedureSource, ProcedureSourceServiceFactory
Servlet
ProcedureSource
.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SOURCE_NAME
ServletProcedureSource
source name.
-
Constructor Summary
Constructors Constructor Description ServletProcedureSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProcedureSource
createService(ServiceContext context)
Creates the service.java.lang.String
getSourceName()
Name of this source.void
listProcedures(ProcedureListContext context)
Provides the availableProcedure
instances for the resource.void
loadManagedFunction(ProcedureManagedFunctionContext context)
Loads theManagedFunction
for theProcedure
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.activity.procedure.spi.ManagedFunctionProcedureSource
loadMethod
-
-
-
-
Field Detail
-
SOURCE_NAME
public static final java.lang.String SOURCE_NAME
ServletProcedureSource
source name.
-
-
Method Detail
-
createService
public ProcedureSource createService(ServiceContext context) throws java.lang.Throwable
Description copied from interface:ServiceFactory
Creates the service.- Specified by:
createService
in interfaceServiceFactory<ProcedureSource>
- Parameters:
context
-ServiceContext
.- Returns:
- Service.
- Throws:
java.lang.Throwable
- If fails to create the service.
-
getSourceName
public java.lang.String getSourceName()
Description copied from interface:ProcedureSource
Name of this source.
Note that this is the name used in configuration to identify this
ProcedureSource
. Therefore, it can not change without causing configurations to be updated.The reasons for using this logical name over
Class
names is:- Class names can be quite long
- Class names are not easily readable
- Enables swapping plugins for same logical service name
- Specified by:
getSourceName
in interfaceProcedureSource
- Returns:
- Name of this source.
-
listProcedures
public void listProcedures(ProcedureListContext context) throws java.lang.Exception
Description copied from interface:ProcedureSource
Provides the availableProcedure
instances for the resource.- Specified by:
listProcedures
in interfaceProcedureSource
- Parameters:
context
-ProcedureListContext
.- Throws:
java.lang.Exception
- If fails to listProcedure
instances.
-
loadManagedFunction
public void loadManagedFunction(ProcedureManagedFunctionContext context) throws java.lang.Exception
Description copied from interface:ManagedFunctionProcedureSource
Loads theManagedFunction
for theProcedure
.- Specified by:
loadManagedFunction
in interfaceManagedFunctionProcedureSource
- Parameters:
context
-ProcedureManagedFunctionContext
.- Throws:
java.lang.Exception
- If fails to load theManagedFunction
.
-
-