|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.config.AbstractFactoryBean org.openspaces.core.jini.JiniServiceFactoryBean
public class JiniServiceFactoryBean
JiniServiceFactoryBean for Jini environments. The class is made up from various samples found on jini.org customized in a Spring specific way. The search will be executed using the provided ServiceTemplate or, if it is null, one will be created using the serviceClass and serviceName. If the lookup operation times out (30 seconds by default), a null service will be returned. For most cases the serviceClass and serviceNames are enough and hide the jini details from the client.
The factoryBean can be configured to do a lookup each time before returning the object type by setting the "singleton" property to false.
The service factory can be configured to return a smart proxy that will try and perform another
lookup in case of an invocation exception (see setSmartProxy(boolean)
. The retry count
can be controlled using setRetryCountOnFailure(int)
.
Constructor Summary | |
---|---|
JiniServiceFactoryBean()
|
Method Summary | |
---|---|
protected Object |
createInstance()
Creates an instance of the service. |
String[] |
getGroups()
Returns the groups. |
String[] |
getLocators()
Returns the locators. |
Class<?> |
getObjectType()
|
Class<?> |
getServiceClass()
|
String |
getServiceName()
|
net.jini.core.lookup.ServiceTemplate |
getTemplate()
|
long |
getTimeout()
The timeout to wait looking up the service |
Object |
invoke(MethodInvocation methodInvocation)
When using smart proxy, wraps the invocation of a service method and in case of failure will try and perform another lookup for the service. |
protected Object |
lookupService()
A helper method to lookup the service. |
void |
setGroups(String[] groups)
The groups to set |
void |
setLocators(String[] locators)
Sets the locators. |
void |
setRetryCountOnFailure(int retryCountOnFailure)
Sets the number of successive method invocation lookup retry count in case of a failure. |
void |
setServiceClass(Class<?> serviceClass)
|
void |
setServiceName(String serviceName)
|
void |
setSmartProxy(boolean smartProxy)
Sets if this proxy will be a smart proxy. |
void |
setTemplate(net.jini.core.lookup.ServiceTemplate template)
|
void |
setTimeout(long timeout)
The timeout to wait looking up the service |
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean |
---|
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JiniServiceFactoryBean()
Method Detail |
---|
public Class<?> getObjectType()
getObjectType
in interface FactoryBean
getObjectType
in class AbstractFactoryBean
protected Object createInstance() throws Exception
lookupService()
and if smart proxy is used, will wrap the returned service with a proxy that performs
lookups in case of failures.
createInstance
in class AbstractFactoryBean
Exception
public Object invoke(MethodInvocation methodInvocation) throws Throwable
invoke
in interface MethodInterceptor
Throwable
protected Object lookupService() throws Exception
Exception
public void setSmartProxy(boolean smartProxy)
true
the service found will be wrapped with a smart proxy that will detect failuers and try
to lookup the service again in such cases. Defaults to false
.
public void setRetryCountOnFailure(int retryCountOnFailure)
public String[] getGroups()
public void setGroups(String[] groups)
public String[] getLocators()
public void setLocators(String[] locators)
public Class<?> getServiceClass()
public void setServiceClass(Class<?> serviceClass)
serviceClass
- The serviceClass to set.public String getServiceName()
public void setServiceName(String serviceName)
serviceName
- The serviceName to set.public net.jini.core.lookup.ServiceTemplate getTemplate()
public void setTemplate(net.jini.core.lookup.ServiceTemplate template)
template
- The template to set.public long getTimeout()
public void setTimeout(long timeout)
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |