Package jadex.platform.service.context
Class ContextService
- java.lang.Object
-
- jadex.bridge.service.BasicService
-
- jadex.platform.service.context.ContextService
-
- All Implemented Interfaces:
IInternalService,IService,IContextService
public class ContextService extends BasicService implements IContextService
Java SE Implementation ofIContextService
-
-
Field Summary
-
Fields inherited from class jadex.bridge.service.BasicService
idcnt, impltype, internalaccess, providerid, shutdowned, sid, started, type
-
Fields inherited from interface jadex.bridge.service.IService
EMPTY_SERVICES
-
-
Constructor Summary
Constructors Constructor Description ContextService(IComponentIdentifier provider)Create a new ContextService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Boolean>dispatchEvent(IJadexAndroidEvent event)Dispatches an Event to the Android UI / Activity.IFuture<java.io.File>getFile(java.lang.String name)Returns a FileIFuture<java.util.List<java.net.InetAddress>>getNetworkIps()Get the network ips.IFuture<IPreferences>getSharedPreferences(java.lang.String preferenceFileName)Gets a Shared Preference Container.IFuture<java.lang.Void>openFile(java.lang.String path)Opens a File with the default application.IFuture<java.lang.Void>shutdownService()Shutdown the service.-
Methods inherited from class jadex.bridge.service.BasicService
createServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getInterfaceType, getInternalAccess, getInvokeMethod, getMethodInfos, getMethodTimeout, getPropertyMap, getProviderId, getServiceId, hashCode, initNFProperties, invokeMethod, isValid, setComponentAccess, setPropertyMap, setServiceIdentifier, startService, toString
-
-
-
-
Constructor Detail
-
ContextService
public ContextService(IComponentIdentifier provider)
Create a new ContextService.
-
-
Method Detail
-
getFile
public IFuture<java.io.File> getFile(java.lang.String name)
Returns a File- Specified by:
getFilein interfaceIContextService- Parameters:
name- File name- Returns:
File
-
getSharedPreferences
public IFuture<IPreferences> getSharedPreferences(java.lang.String preferenceFileName)
Gets a Shared Preference Container. Returns null on Desktop Systems.- Specified by:
getSharedPreferencesin interfaceIContextService- Parameters:
preferenceFileName-
-
dispatchEvent
public IFuture<java.lang.Boolean> dispatchEvent(IJadexAndroidEvent event)
Dispatches an Event to the Android UI / Activity. Does nothing on Desktop Systems.- Specified by:
dispatchEventin interfaceIContextService- Parameters:
event-IJadexAndroidEvent- Returns:
- true, if at least one receiver was registered for this event and delivery was successful, else false.
-
getNetworkIps
public IFuture<java.util.List<java.net.InetAddress>> getNetworkIps()
Get the network ips.- Specified by:
getNetworkIpsin interfaceIContextService
-
openFile
public IFuture<java.lang.Void> openFile(java.lang.String path) throws java.io.IOException
Opens a File with the default application.- Specified by:
openFilein interfaceIContextService- Parameters:
path-- Throws:
java.io.IOException
-
shutdownService
public IFuture<java.lang.Void> shutdownService()
Description copied from class:BasicServiceShutdown the service.- Specified by:
shutdownServicein interfaceIInternalService- Overrides:
shutdownServicein classBasicService- Returns:
- A future that is done when the service has completed its shutdown.
-
-