Package net.officefloor.jdbc
Class ReadOnlyConnectionManagedObjectSource
- java.lang.Object
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<None,None>
-
- net.officefloor.jdbc.AbstractJdbcManagedObjectSource
-
- net.officefloor.jdbc.ReadOnlyConnectionManagedObjectSource
-
- All Implemented Interfaces:
ManagedObject
,ManagedObjectSource<None,None>
- Direct Known Subclasses:
H2ReadOnlyConnectionManagedObjectSource
,PostgreSqlReadOnlyConnectionManagedObjectSource
public class ReadOnlyConnectionManagedObjectSource extends AbstractJdbcManagedObjectSource implements ManagedObject
Read-onlyConnection
ManagedObjectSource
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.jdbc.AbstractJdbcManagedObjectSource
AbstractJdbcManagedObjectSource.ConnectionConnectivity, AbstractJdbcManagedObjectSource.Connectivity, AbstractJdbcManagedObjectSource.ConnectivityFactory
-
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext
-
-
Field Summary
-
Fields inherited from class net.officefloor.jdbc.AbstractJdbcManagedObjectSource
PROPERTY_DATA_SOURCE_FACTORY, PROPERTY_DATA_SOURCE_VALIDATE_SQL
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyConnectionManagedObjectSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ManagedObject
getManagedObject()
Synchronously obtains theManagedObject
.java.lang.Object
getObject()
Obtains the object being managed.protected void
setupActive(ManagedObjectSourceContext<None> mosContext)
Sets up theManagedObjectSource
for active use.protected void
setupMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context)
Sets up the meta-data.void
start(ManagedObjectExecuteContext<None> context)
Called once afterManagedObjectSource.init(ManagedObjectSourceContext)
to indicate thisManagedObjectSource
should start execution.void
stop()
Called to notify that theOfficeFloor
is being closed.-
Methods inherited from class net.officefloor.jdbc.AbstractJdbcManagedObjectSource
closeDataSource, getConnectionPoolDataSourceFactory, getDataSourceFactory, loadMetaData, loadSpecification, loadValidateConnectivity, newConnectionPoolDataSource, newDataSource, setConnectivity, validateConnectivity
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObject
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init
-
-
-
-
Method Detail
-
setupMetaData
protected void setupMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context) throws java.lang.Exception
Description copied from class:AbstractJdbcManagedObjectSource
Sets up the meta-data.- Specified by:
setupMetaData
in classAbstractJdbcManagedObjectSource
- Parameters:
context
-AbstractAsyncManagedObjectSource.MetaDataContext
.- Throws:
java.lang.Exception
- If fails to loader further meta-data.
-
setupActive
protected void setupActive(ManagedObjectSourceContext<None> mosContext) throws java.lang.Exception
Description copied from class:AbstractJdbcManagedObjectSource
Sets up theManagedObjectSource
for active use.- Specified by:
setupActive
in classAbstractJdbcManagedObjectSource
- Parameters:
mosContext
-ManagedObjectSourceContext
.- Throws:
java.lang.Exception
- If fails to setup.
-
start
public void start(ManagedObjectExecuteContext<None> context) throws java.lang.Exception
Description copied from interface:ManagedObjectSource
Called once after
ManagedObjectSource.init(ManagedObjectSourceContext)
to indicate thisManagedObjectSource
should start execution.On invocation of this method,
ProcessState
instances may be invoked via theManagedObjectExecuteContext
.- Specified by:
start
in interfaceManagedObjectSource<None,None>
- Overrides:
start
in classAbstractAsyncManagedObjectSource<None,None>
- Parameters:
context
-ManagedObjectExecuteContext
to use in starting thisManagedObjectSource
.- Throws:
java.lang.Exception
- Should theManagedObjectSource
fail to start execution.
-
stop
public void stop()
Description copied from interface:ManagedObjectSource
Called to notify that the
OfficeFloor
is being closed.On return from this method, no further
ProcessState
instances may be invoked.- Specified by:
stop
in interfaceManagedObjectSource<None,None>
- Overrides:
stop
in classAbstractAsyncManagedObjectSource<None,None>
-
getManagedObject
protected ManagedObject getManagedObject() throws java.lang.Throwable
Description copied from class:AbstractManagedObjectSource
Synchronously obtains theManagedObject
.- Specified by:
getManagedObject
in classAbstractManagedObjectSource<None,None>
- Returns:
ManagedObject
.- Throws:
java.lang.Throwable
- If fails to obtain theManagedObject
.
-
getObject
public java.lang.Object getObject() throws java.lang.Throwable
Description copied from interface:ManagedObject
Obtains the object being managed.- Specified by:
getObject
in interfaceManagedObject
- Returns:
- Object being managed.
- Throws:
java.lang.Throwable
- Indicating failed to obtain the object for use.
-
-