Package net.officefloor.server.http.mock
Class MockManagedObjectContext
- java.lang.Object
-
- net.officefloor.server.http.mock.MockManagedObjectContext
-
- All Implemented Interfaces:
ManagedObjectContext
public class MockManagedObjectContext extends java.lang.Object implements ManagedObjectContext
MockManagedObjectContext
that just runs theProcessSafeOperation
.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description MockManagedObjectContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBoundName()
Obtains the name thisManagedObject
is bound under.java.util.logging.Logger
getLogger()
Obtains theLogger
for theManagedObject
.<R,T extends java.lang.Throwable>
Rrun(ProcessSafeOperation<R,T> operation)
Undertakes aProcessSafeOperation
.
-
-
-
Method Detail
-
getBoundName
public java.lang.String getBoundName()
Description copied from interface:ManagedObjectContext
Obtains the name this
ManagedObject
is bound under.This is useful to have a unique name identifying the
ManagedObject
.- Specified by:
getBoundName
in interfaceManagedObjectContext
- Returns:
- Name this
ManagedObject
is bound under.
-
getLogger
public java.util.logging.Logger getLogger()
Description copied from interface:ManagedObjectContext
Obtains theLogger
for theManagedObject
.- Specified by:
getLogger
in interfaceManagedObjectContext
- Returns:
Logger
for theManagedObject
.
-
run
public <R,T extends java.lang.Throwable> R run(ProcessSafeOperation<R,T> operation) throws T extends java.lang.Throwable
Description copied from interface:ManagedObjectContext
Undertakes aProcessSafeOperation
.- Specified by:
run
in interfaceManagedObjectContext
- Type Parameters:
R
- Return type from operationT
- PossibleThrowable
type from operation.- Parameters:
operation
-ProcessSafeOperation
.- Returns:
- Return value.
- Throws:
T
- PossibleThrowable
.T extends java.lang.Throwable
-
-