Package net.officefloor.pay.paypal
Class PayPalHttpClientManagedObjectSource
- java.lang.Object
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows>
-
- net.officefloor.pay.paypal.PayPalHttpClientManagedObjectSource
-
- All Implemented Interfaces:
ManagedObject,ManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows>
public class PayPalHttpClientManagedObjectSource extends AbstractManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows> implements ManagedObject
ManagedObjectSourcefor thePayPalHttpClient.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPayPalHttpClientManagedObjectSource.ConfigureDependenciesstatic classPayPalHttpClientManagedObjectSource.Flows-
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
-
-
Constructor Summary
Constructors Constructor Description PayPalHttpClientManagedObjectSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ManagedObjectgetManagedObject()Synchronously obtains theManagedObject.java.lang.ObjectgetObject()Obtains the object being managed.protected voidloadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,PayPalHttpClientManagedObjectSource.Flows> context)Overridden to load meta-data.protected voidloadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)Overridden to load specifications.static voidsetPayPalHttpClient(com.paypal.core.PayPalHttpClient paypalHttpClient)Sets using thePayPalHttpClient.voidstart(ManagedObjectExecuteContext<PayPalHttpClientManagedObjectSource.Flows> context)Called once afterManagedObjectSource.init(ManagedObjectSourceContext)to indicate thisManagedObjectSourceshould start execution.-
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, stop
-
-
-
-
Method Detail
-
setPayPalHttpClient
public static void setPayPalHttpClient(com.paypal.core.PayPalHttpClient paypalHttpClient)
Sets using the
PayPalHttpClient.This is typically used for testing to allow overriding the
PayPalHttpClientbeing used.- Parameters:
paypalHttpClient-PayPalHttpClient. May benullto not override.
-
loadSpecification
protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from class:AbstractAsyncManagedObjectSourceOverridden to load specifications.- Specified by:
loadSpecificationin classAbstractAsyncManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows>- Parameters:
context- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,PayPalHttpClientManagedObjectSource.Flows> context) throws java.lang.Exception
Description copied from class:AbstractAsyncManagedObjectSourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractAsyncManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows>- Parameters:
context- Meta-data.- Throws:
java.lang.Exception- If fails to load the meta-data.
-
start
public void start(ManagedObjectExecuteContext<PayPalHttpClientManagedObjectSource.Flows> context) throws java.lang.Exception
Description copied from interface:ManagedObjectSourceCalled once after
ManagedObjectSource.init(ManagedObjectSourceContext)to indicate thisManagedObjectSourceshould start execution.On invocation of this method,
ProcessStateinstances may be invoked via theManagedObjectExecuteContext.- Specified by:
startin interfaceManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows>- Overrides:
startin classAbstractAsyncManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows>- Parameters:
context-ManagedObjectExecuteContextto use in starting thisManagedObjectSource.- Throws:
java.lang.Exception- Should theManagedObjectSourcefail to start execution.
-
getManagedObject
protected ManagedObject getManagedObject() throws java.lang.Throwable
Description copied from class:AbstractManagedObjectSourceSynchronously obtains theManagedObject.- Specified by:
getManagedObjectin classAbstractManagedObjectSource<None,PayPalHttpClientManagedObjectSource.Flows>- Returns:
ManagedObject.- Throws:
java.lang.Throwable- If fails to obtain theManagedObject.
-
getObject
public java.lang.Object getObject() throws java.lang.ThrowableDescription copied from interface:ManagedObjectObtains the object being managed.- Specified by:
getObjectin interfaceManagedObject- Returns:
- Object being managed.
- Throws:
java.lang.Throwable- Indicating failed to obtain the object for use.
-
-