Package org.osgi.service.application
Interface ScheduledApplication
public interface ScheduledApplication
It is allowed to schedule an application based on a specific event.
ScheduledApplication service keeps the schedule information. When the
specified event is fired a new instance must be launched. Note that launching
operation may fail because e.g. the application is locked.
Each ScheduledApplication
instance has an identifier which is
unique within the scope of the application being scheduled.
ScheduledApplication
instances are registered as services. The
APPLICATION_PID
service property contains the PID of the application
being scheduled, the SCHEDULE_ID
service property contains the
schedule identifier.
- Version:
- $Id: 797fedaaadb344b967c37df3e76c97a35bf5cb2f $
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The property key for the identifier of the application being scheduled.static final String
The name of the day of month attribute of a virtual timer event.static final String
The name of the day of week attribute of a virtual timer event.static final String
The name of the hour of day attribute of a virtual timer event.static final String
The name of the minute attribute of a virtual timer event.static final String
The name of the month attribute of a virtual timer event.static final String
The property key for the schedule identifier.static final String
The topic name for the virtual timer topic.static final String
The key for the startup argument used to pass the event object that triggered the schedule to launch the application instance.static final String
The name of the year attribute of a virtual timer event. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the ApplicationDescriptor which represents the application and necessary for launching.Queries the startup arguments specified when the application was scheduled.Queries the event filter for the triggering event.Returns the identifier of this schedule.getTopic()
Queries the topic of the triggering event.boolean
Queries if the schedule is recurring.void
remove()
Cancels this schedule of the application.
-
Field Details
-
APPLICATION_PID
The property key for the identifier of the application being scheduled.- See Also:
-
SCHEDULE_ID
The property key for the schedule identifier. The identifier is unique within the scope of the application being scheduled.- See Also:
-
TRIGGERING_EVENT
The key for the startup argument used to pass the event object that triggered the schedule to launch the application instance. The event is passed in aGuardedObject
protected by the correspondingTopicPermission
.- See Also:
-
TIMER_TOPIC
The topic name for the virtual timer topic. Time based schedules should be created using this topic.- See Also:
-
YEAR
The name of the year attribute of a virtual timer event. The value is defined byCalendar.YEAR
.- See Also:
-
MONTH
The name of the month attribute of a virtual timer event. The value is defined byCalendar.MONTH
.- See Also:
-
DAY_OF_MONTH
The name of the day of month attribute of a virtual timer event. The value is defined byCalendar.DAY_OF_MONTH
.- See Also:
-
DAY_OF_WEEK
The name of the day of week attribute of a virtual timer event. The value is defined byCalendar.DAY_OF_WEEK
.- See Also:
-
HOUR_OF_DAY
The name of the hour of day attribute of a virtual timer event. The value is defined byCalendar.HOUR_OF_DAY
.- See Also:
-
MINUTE
The name of the minute attribute of a virtual timer event. The value is defined byCalendar.MINUTE
.- See Also:
-
-
Method Details
-
getScheduleId
String getScheduleId()Returns the identifier of this schedule. The identifier is unique within the scope of the application that the schedule is related to.- Returns:
- the identifier of this schedule
-
getTopic
String getTopic()Queries the topic of the triggering event. The topic may contain a trailing asterisk as wildcard.- Returns:
- the topic of the triggering event
- Throws:
IllegalStateException
- if the scheduled application service is unregistered
-
getEventFilter
String getEventFilter()Queries the event filter for the triggering event.- Returns:
- the event filter for triggering event
- Throws:
IllegalStateException
- if the scheduled application service is unregistered
-
isRecurring
boolean isRecurring()Queries if the schedule is recurring.- Returns:
- true if the schedule is recurring, otherwise returns false
- Throws:
IllegalStateException
- if the scheduled application service is unregistered
-
getApplicationDescriptor
ApplicationDescriptor getApplicationDescriptor()Retrieves the ApplicationDescriptor which represents the application and necessary for launching.- Returns:
- the application descriptor that represents the scheduled application
- Throws:
IllegalStateException
- if the scheduled application service is unregistered
-
getArguments
Map getArguments()Queries the startup arguments specified when the application was scheduled. The method returns a copy of the arguments, it is not possible to modify the arguments after scheduling.- Returns:
- the startup arguments of the scheduled application. It may be null if null argument was specified.
- Throws:
IllegalStateException
- if the scheduled application service is unregistered
-
remove
void remove()Cancels this schedule of the application.- Throws:
SecurityException
- if the caller doesn't have "schedule" ApplicationAdminPermission for the scheduled application.IllegalStateException
- if the scheduled application service is unregistered
-