Package com.j_spaces.core.service
Class ServiceAdminImpl
java.lang.Object
com.j_spaces.core.service.ServiceAdminImpl
- All Implemented Interfaces:
ServiceAdmin,DestroyAdmin,Remote,JoinAdmin
- Direct Known Subclasses:
JSpaceAdminImpl
Copyright (c) 2010 GigaSpaces Technologies Ltd. All rights reserved
The software source code is proprietary and confidential information of GigaSpaces. You may use
the software source code solely under the terms and limitations of The license agreement granted
to you by GigaSpaces.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RemoteExceptionprotected ServiceAdminProxyThe ServiceAdminProxyprotected ExporterThe Exporter for the ServiceAdminprotected AbstractServiceThe service instanceprotected ServiceAdminThe remote reference to myselfprotected static final longMaximum delay for unexport attempts -
Constructor Summary
ConstructorsConstructorDescriptionServiceAdminImpl(AbstractService service, Exporter exporter) Constructs aServiceAdminImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLookupAttributes(Entry[] attrSets) Add attribute sets for the service.voidaddLookupGroups(String[] groups) Add new groups to the set to join.voidaddLookupLocators(LookupLocator[] locators) Add locators for specific new lookup services to join.voiddestroy()Destroy the service, if possible, including its persistent storage.Entry[]Get the current attribute sets for the service.String[]Get the list of groups to join.Get the list of locators of specific lookup services to join.getProxy()Get the object to communicate with the ServiceAdminImplvoidmodifyLookupAttributes(Entry[] attrSetTemplates, Entry[] attrSets) Modify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes.voidremoveLookupGroups(String[] groups) Remove groups from the set to join.voidremoveLookupLocators(LookupLocator[] locators) Remove locators for specific lookup services from the set to join.voidsetLookupGroups(String[] groups) Replace the list of groups to join with a new list.voidsetLookupLocators(LookupLocator[] locators) Replace the list of locators of specific lookup services to join with a new list.voidunexport(boolean force) Unexport the ServiceAdminprotected voidThrow theRemoteExceptionin case of JoinManager is null.
-
Field Details
-
MAX_UNEXPORT_DELAY
protected static final long MAX_UNEXPORT_DELAYMaximum delay for unexport attempts- See Also:
-
joinManagerNullException
-
m_service
The service instance -
m_exporter
The Exporter for the ServiceAdmin -
m_thisRemoteRef
The remote reference to myself -
m_adminProxy
The ServiceAdminProxy
-
-
Constructor Details
-
ServiceAdminImpl
Constructs aServiceAdminImpl.- Throws:
RemoteException
-
-
Method Details
-
getProxy
Get the object to communicate with the ServiceAdminImpl -
unexport
public void unexport(boolean force) Unexport the ServiceAdmin -
validateJoinManager
Throw theRemoteExceptionin case of JoinManager is null.- Throws:
RemoteException
-
destroy
Description copied from interface:DestroyAdminDestroy the service, if possible, including its persistent storage. This method should (in effect) spawn a separate thread to do the actual work asynchronously, and make a reasonable attempt to let this remote call return successfully. As such, a successful return from this method does not mean that the service has been destroyed. Although the service should make a reasonable attempt to let this remote call return successfully, the service must not wait indefinitely for other (in-progress and subsequent) remote calls to finish before proceeding to destroy itself. Once this method has been called, the service can, but need not, reject all other (in-progress and subsequent) remote calls to the service.- Specified by:
destroyin interfaceDestroyAdmin- Specified by:
destroyin interfaceServiceAdmin- Throws:
RemoteException
-
getLookupAttributes
Description copied from interface:JoinAdminGet the current attribute sets for the service.- Specified by:
getLookupAttributesin interfaceJoinAdmin- Returns:
- the current attribute sets for the service
- Throws:
RemoteException
-
addLookupAttributes
Description copied from interface:JoinAdminAdd attribute sets for the service. The resulting set will be used for all future joins. The attribute sets are also added to all currently-joined lookup services.- Specified by:
addLookupAttributesin interfaceJoinAdmin- Parameters:
attrSets- the attribute sets to add- Throws:
RemoteException
-
modifyLookupAttributes
public void modifyLookupAttributes(Entry[] attrSetTemplates, Entry[] attrSets) throws RemoteException Description copied from interface:JoinAdminModify the current attribute sets, using the same semantics as ServiceRegistration.modifyAttributes. The resulting set will be used for all future joins. The same modifications are also made to all currently-joined lookup services.- Specified by:
modifyLookupAttributesin interfaceJoinAdmin- Parameters:
attrSetTemplates- the templates for matching attribute setsattrSets- the modifications to make to matching sets- Throws:
RemoteException- See Also:
-
getLookupGroups
Description copied from interface:JoinAdminGet the list of groups to join. An empty array means the service joins no groups (as opposed to "all" groups).- Specified by:
getLookupGroupsin interfaceJoinAdmin- Returns:
- an array of groups to join. An empty array means the service joins no groups (as opposed to "all" groups).
- Throws:
RemoteException- See Also:
-
addLookupGroups
Description copied from interface:JoinAdminAdd new groups to the set to join. Lookup services in the new groups will be discovered and joined.- Specified by:
addLookupGroupsin interfaceJoinAdmin- Parameters:
groups- groups to join- Throws:
RemoteException- See Also:
-
removeLookupGroups
Description copied from interface:JoinAdminRemove groups from the set to join. Leases are cancelled at lookup services that are not members of any of the remaining groups.- Specified by:
removeLookupGroupsin interfaceJoinAdmin- Parameters:
groups- groups to leave- Throws:
RemoteException- See Also:
-
setLookupGroups
Description copied from interface:JoinAdminReplace the list of groups to join with a new list. Leases are cancelled at lookup services that are not members of any of the new groups. Lookup services in the new groups will be discovered and joined.- Specified by:
setLookupGroupsin interfaceJoinAdmin- Parameters:
groups- groups to join- Throws:
RemoteException- See Also:
-
getLookupLocators
Description copied from interface:JoinAdminGet the list of locators of specific lookup services to join.- Specified by:
getLookupLocatorsin interfaceJoinAdmin- Returns:
- the list of locators of specific lookup services to join
- Throws:
RemoteException- See Also:
-
addLookupLocators
Description copied from interface:JoinAdminAdd locators for specific new lookup services to join. The new lookup services will be discovered and joined.- Specified by:
addLookupLocatorsin interfaceJoinAdmin- Parameters:
locators- locators of specific lookup services to join- Throws:
RemoteException- See Also:
-
removeLookupLocators
Description copied from interface:JoinAdminRemove locators for specific lookup services from the set to join. Any leases held at the lookup services are cancelled.- Specified by:
removeLookupLocatorsin interfaceJoinAdmin- Parameters:
locators- locators of specific lookup services to leave- Throws:
RemoteException- See Also:
-
setLookupLocators
Description copied from interface:JoinAdminReplace the list of locators of specific lookup services to join with a new list. Leases are cancelled at lookup services that were in the old list but are not in the new list. Any new lookup services will be discovered and joined.- Specified by:
setLookupLocatorsin interfaceJoinAdmin- Parameters:
locators- locators of specific lookup services to join- Throws:
RemoteException- See Also:
-