com.atlassian.sal.confluence.lifecycle
Class ServiceExecutionTemplate<S,R>

java.lang.Object
  extended by com.atlassian.sal.confluence.lifecycle.ServiceExecutionTemplate<S,R>
Type Parameters:
S - the service getting executed
R - the result of the service execution
All Implemented Interfaces:
java.util.concurrent.Callable<com.atlassian.fugue.Option<R>>
Direct Known Subclasses:
StaticServiceExecution

public abstract class ServiceExecutionTemplate<S,R>
extends java.lang.Object
implements java.util.concurrent.Callable<com.atlassian.fugue.Option<R>>

Template for service executions.

Since:
5.6

Field Summary
protected  org.osgi.framework.ServiceReference serviceReference
           
 
Constructor Summary
ServiceExecutionTemplate(org.osgi.framework.ServiceReference serviceReference)
           
 
Method Summary
 com.atlassian.fugue.Option<R> call()
           
protected abstract  R execute(S service)
           
protected  java.lang.String serviceReferenceToString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceReference

protected final org.osgi.framework.ServiceReference serviceReference
Constructor Detail

ServiceExecutionTemplate

public ServiceExecutionTemplate(org.osgi.framework.ServiceReference serviceReference)
Method Detail

serviceReferenceToString

protected java.lang.String serviceReferenceToString()

call

public com.atlassian.fugue.Option<R> call()
                                   throws java.lang.Exception
Specified by:
call in interface java.util.concurrent.Callable<com.atlassian.fugue.Option<R>>
Throws:
java.lang.Exception

execute

protected abstract R execute(S service)


Copyright © 2003-2014 Atlassian. All Rights Reserved.