1 IMPLEMENTING AN IMPLEMENTING AN ACTIVE FUNCTIONALITY ACTIVE FUNCTIONALITY SERVICE SERVICE ON DIFFERENT PLATFORMS ON DIFFERENT PLATFORMS Candidate: Candidate: Antollini, Juan José Antollini, Juan José Advisor: Advisor: Cilia, Mariano Cilia, Mariano Universidad Nacional del Centro de la Provincia de Universidad Nacional del Centro de la Provincia de Buenos Aires Buenos Aires Facultad de Ciencias Exactas Facultad de Ciencias Exactas Tandil, Argentina - Tandil, Argentina - July July , 2005 , 2005
33
Embed
1 IMPLEMENTING AN ACTIVE FUNCTIONALITY SERVICE ON DIFFERENT PLATFORMS Candidate: Antollini, Juan José Advisor: Cilia, Mariano Cilia, Mariano Universidad.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
11
IMPLEMENTING ANIMPLEMENTING AN ACTIVE FUNCTIONALITY ACTIVE FUNCTIONALITY
SERVICE SERVICE ON DIFFERENT PLATFORMSON DIFFERENT PLATFORMS
Candidate:Candidate:Antollini, Juan JoséAntollini, Juan José
Advisor:Advisor: Cilia, MarianoCilia, Mariano
Universidad Nacional del Centro de la Provincia de Buenos AiresUniversidad Nacional del Centro de la Provincia de Buenos AiresFacultad de Ciencias ExactasFacultad de Ciencias Exactas
Tandil, Argentina - Tandil, Argentina - JulyJuly, 2005, 2005
22
OrganizationOrganization
MotivationMotivation Main PillarsMain Pillars ImplementationImplementation Adaptation for Different PlatformsAdaptation for Different Platforms Conclusions & Future WorkConclusions & Future Work
33
MotivationMotivation
Today we are living a technology convergence Today we are living a technology convergence leading to an increasing information flowleading to an increasing information flow
This requires new paradigms for its appropriate This requires new paradigms for its appropriate administration and processingadministration and processing
chain management, Auto-ID, e-businesschain management, Auto-ID, e-business These apps are characterized by the reaction to These apps are characterized by the reaction to
situations of interestsituations of interest Monitoring situations of interestMonitoring situations of interest React accordinglyReact accordingly
44
Active DBMSActive DBMS
One approach was the inclusion of powerful One approach was the inclusion of powerful active active rule-rule-processing capabilities processing capabilities
Reactive mechanisms were introduced in the form of Reactive mechanisms were introduced in the form of Event-Condition-Action rules in database systemsEvent-Condition-Action rules in database systems
Avoid unnecessary pollingAvoid unnecessary polling Data is stored in the database, situations of interest Data is stored in the database, situations of interest
(events) are detected, appropriate reactions are executed(events) are detected, appropriate reactions are executed
aD BM S
STIMULI
DATABASE
REACTIVE MECHANISM
EFFECT
55
Distributed Reactive SystemsDistributed Reactive Systems But not all applications need a full-fledge database, just want to use But not all applications need a full-fledge database, just want to use
the reactive functionalitythe reactive functionality Distributed Reactive Systems respond to stimuli to bring desirable Distributed Reactive Systems respond to stimuli to bring desirable
effects in their environmenteffects in their environment Three different approachesThree different approaches
The reaction to events on the application-side is The reaction to events on the application-side is normally hard-coded and has been difficult to normally hard-coded and has been difficult to adapt to new requirements quicklyadapt to new requirements quickly
The goal of this work is to provide a flexible The goal of this work is to provide a flexible platform for platform for Reactive FunctionalityReactive Functionality in open in open distributed and heterogeneous environmentsdistributed and heterogeneous environments
Decoupled from database systemsDecoupled from database systems Offering an autonomous and flexible serviceOffering an autonomous and flexible service Can be combined in many different ways and used in Can be combined in many different ways and used in
a variety of environmentsa variety of environments
77
A Three Step ProcessA Three Step Process Rule Definition:Rule Definition:
An ECA-Rule is the entity that encapsulates all the desired An ECA-Rule is the entity that encapsulates all the desired functionality required for this reactive systemfunctionality required for this reactive system
Service Configuration:Service Configuration: According to the rule defined in the previous step, the appropriate According to the rule defined in the previous step, the appropriate
services are located through a Service Platformservices are located through a Service Platform Once the corresponding services are located, the rule is Once the corresponding services are located, the rule is
decomposed and passed to these servicesdecomposed and passed to these services Service Run-time:Service Run-time:
Once the Services have been configured and started the Once the Services have been configured and started the corresponding services “wait” until specified events are signaledcorresponding services “wait” until specified events are signaled
When they are detected, those services are triggered by receiving When they are detected, those services are triggered by receiving this notification and they start processing according to the rule this notification and they start processing according to the rule definitiondefinition
All the elementary services rely on a notification service for the All the elementary services rely on a notification service for the dissemination of datadissemination of data
88
Active Functionality ServiceActive Functionality Service
Main building blocksMain building blocks ECA Rule DefinitionECA Rule Definition Elementary ServicesElementary Services Service Platform IndependenceService Platform Independence Event Dissemination MechanismEvent Dissemination Mechanism Ontology (or Common Vocabulary)Ontology (or Common Vocabulary) Plug-insPlug-ins Service Manager (ECA Manager)Service Manager (ECA Manager) Repository ServiceRepository Service
A logic expression that includes boolean operators (A logic expression that includes boolean operators (ANDAND, , OROR, , NOTNOT) and comparisons operators () and comparisons operators (==, , !=!=, , <<,,<=<=, , > , >=)> , >=)
They are composed by They are composed by references references and and valuesvalues. The references . The references are replaced at run-time and then evaluatedare replaced at run-time and then evaluated
Condition:Condition: A condition that is evaluated. If true, follows the series of stepsA condition that is evaluated. If true, follows the series of steps It is not mandatory and reflects a deeper level of filtering before It is not mandatory and reflects a deeper level of filtering before
executing any actionexecuting any action It is also comprised by It is also comprised by logic expressions logic expressions It allows the use of plug-insIt allows the use of plug-ins
Action:Action: The action that takes place when the event of interest arrives The action that takes place when the event of interest arrives
and the condition evaluation finishes successfullyand the condition evaluation finishes successfully A set of actions have been provided. More actions can be addedA set of actions have been provided. More actions can be added It can also operate with plug-insIt can also operate with plug-ins
Rule definition
RULE wayToWorkONIF
THEN
EngineStarted DriverIdentification = “Paul”
AND IsWorkingDay LoadDriverPreferences(”Paul”)
1212
ECA ManagerECA Manager
Plays the role of a representative of the Active Plays the role of a representative of the Active Functionality ServiceFunctionality Service
Responsible for rule registration:Responsible for rule registration:1.1. Decomposing the rule,Decomposing the rule,
2.2. Searching and contacting the elementary services,Searching and contacting the elementary services,
3.3. Configuring the elementary services andConfiguring the elementary services and
4.4. Deploying the elementary servicesDeploying the elementary services
It also offers operations to activate, deactivate It also offers operations to activate, deactivate and unregister rulesand unregister rules
Service Registry andRule Repository
ECA-Manager
1313
Elementary Services (1)Elementary Services (1)
Each component was designed according to the Each component was designed according to the properties of distributed heterogeneous systemsproperties of distributed heterogeneous systems
They are responsible for:They are responsible for: Complex event detection,Complex event detection, Event filtering,Event filtering, Condition evaluation, andCondition evaluation, and Action executionAction execution
Elementary services expose two kinds of generic and Elementary services expose two kinds of generic and very simple interfaces:very simple interfaces:1.1. A configuration interface used for administration purposes, such A configuration interface used for administration purposes, such
as registration, activation, de-activation, etcas registration, activation, de-activation, etc2.2. A service interface to receive event notificationsA service interface to receive event notifications
EventCompositor
ConditionEvaluation
ActionExecution
1414
Elementary Services (2)Elementary Services (2)
Separation of logic:Separation of logic: Service Logic Service Logic which: the code that represents the which: the code that represents the
operation of the service itselfoperation of the service itself Functional Logic: Functional Logic: a wrapper that makes the service a wrapper that makes the service
logic work within a frameworklogic work within a framework
They are contacted and administered through They are contacted and administered through the use of a Service Platformthe use of a Service Platform
They are combined through the use of a They are combined through the use of a common notification mechanismcommon notification mechanism
EventCompositor
ConditionEvaluation
ActionExecution
1515
Elementary Services (3)Elementary Services (3)
Functional Logic Service LogicFunctional Logic Service Logic
EventCompositor
ConditionEvaluation
ActionExecution
1616
Notification Service (NS)Notification Service (NS)
Event-based systems need an event dissemination Event-based systems need an event dissemination mechanism to deliver relevant events to interested mechanism to deliver relevant events to interested consumersconsumers
Events are disseminated as notifications by a Events are disseminated as notifications by a publish/subscribe notification servicepublish/subscribe notification service
The publish/subscribe paradigm plays an important role The publish/subscribe paradigm plays an important role in this architecture providing the following advantages:in this architecture providing the following advantages: It allows asynchronous communication and decouples event It allows asynchronous communication and decouples event
producers and consumersproducers and consumers The notification contains required event information and its The notification contains required event information and its
contextcontext It provides a simple and powerful generic communication modelIt provides a simple and powerful generic communication model Events are the ones that directly trigger rule executionEvents are the ones that directly trigger rule execution
EventCompositor
1717
NS: Concept-based AddressingNS: Concept-based Addressing Subscriptions are raised to a higher level of Subscriptions are raised to a higher level of
expressivenessexpressiveness It provides a higher level of abstraction to describe the It provides a higher level of abstraction to describe the
interests of event producers and consumersinterests of event producers and consumers It is achieved by supporting from the ground up It is achieved by supporting from the ground up
ontologiesontologies (or common vocabulary) which provide the (or common vocabulary) which provide the base for correct data and event interpretationbase for correct data and event interpretation
Metadata information and conversion functions to Metadata information and conversion functions to simplify and enrich their interaction are providedsimplify and enrich their interaction are provided
Event consumers specify the context to which events Event consumers specify the context to which events need to be converted before they are delivered for client need to be converted before they are delivered for client processingprocessing
It allows abstractions from NS particularitiesIt allows abstractions from NS particularities
EventCompositor
1818
Plug-ins (1)Plug-ins (1) Conceived to increase the functionality of the system by Conceived to increase the functionality of the system by
the aid of external applications (i.e. a Database System)the aid of external applications (i.e. a Database System) Every plug-in is composed by a Every plug-in is composed by a sentence sentence part and a part and a
configuration configuration partpart The statement syntax provides a mean to express The statement syntax provides a mean to express
ontology concepts that will be resolved according to ontology concepts that will be resolved according to incoming notificationsincoming notifications
Ontology references must be written inside opening and Ontology references must be written inside opening and closing braces (“[“ “]”) and must contain concept names closing braces (“[“ “]”) and must contain concept names supported by the ontologysupported by the ontology
The configuration part is used to tune the external The configuration part is used to tune the external applicationapplication
This approach allows users to create their own plug-ins This approach allows users to create their own plug-ins in a straightforward fashionin a straightforward fashion
1919
Plug-ins (2)Plug-ins (2)
Two types:Two types: Application-specificApplication-specific for particular application (i.e. calendar) for particular application (i.e. calendar) Generic plug-insGeneric plug-ins (i.e. databases) (i.e. databases)
Data
Convert(context defined
by user)
Convert(context definedby programmer)
Base Software (generic use)i.e. Database
Particular Applicationi.e. Calendar
Plu
g-i
nIn
com
ing
dat
a
Data ’
AlreadyConverted
Data
Data ’
Base Software Specific Application
2020
Plug-ins (3)Plug-ins (3)
• How to write plug-ins:How to write plug-ins:1.1. Ontology specific concepts must be createdOntology specific concepts must be created2.2. A new plug-in class extending the A new plug-in class extending the PlugInIntfPlugInIntf
interface must be codedinterface must be coded3.3. A new configuration class extending the A new configuration class extending the
ConfigurationIntfConfigurationIntf interface must be coded interface must be coded4.4. The plug-in must be registered into the The plug-in must be registered into the
repository. One or more keywords and a repository. One or more keywords and a plug-in configuration (if needed) must be plug-in configuration (if needed) must be added to the plug-in repositoryadded to the plug-in repository
2121
Service PlatformsService Platforms
The use of Service Platforms allows:The use of Service Platforms allows: Life-cycle management for the different servicesLife-cycle management for the different services Remote access to servicesRemote access to services
The same functionality implemented on two The same functionality implemented on two platforms:platforms: J2EE (enterprise applications)J2EE (enterprise applications)
A robust platform designed for distributed or client-server A robust platform designed for distributed or client-server interaction. It provides the ease for persistence, interaction. It provides the ease for persistence, asynchronous communications and remote access to objectsasynchronous communications and remote access to objects
OSGi (small devices)OSGi (small devices) Intended for (remotely deployable) service-oriented Intended for (remotely deployable) service-oriented
applications. It is a lightweight platform where different applications. It is a lightweight platform where different services can be deployed, installed and executed allowing services can be deployed, installed and executed allowing simple sharing and interaction among themsimple sharing and interaction among them
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2222
J2EEJ2EE
Defines three kinds of Enterprise Java Beans Defines three kinds of Enterprise Java Beans (EJB), each one with definite purposes and (EJB), each one with definite purposes and activities:activities: Session beansSession beans Entity beansEntity beans Message-driven beansMessage-driven beans
Services were adapted to each one of these Services were adapted to each one of these EJB’sEJB’s
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2323
Session & Entity BeansSession & Entity Beans
Session beans:Session beans: ECA-Manager wrapped as a Session BeanECA-Manager wrapped as a Session Bean An ECA-Manager instance is held An ECA-Manager instance is held inside inside the Session Beanthe Session Bean It complies with the Session façade patternIt complies with the Session façade pattern
Entity beans:Entity beans: Every rule definition and every plug-in implementation are Every rule definition and every plug-in implementation are
stored in a stored in a Repository Service Repository Service in order to maintain information in order to maintain information about the active functionality serviceabout the active functionality service
This persistence is achieved by the use of Entity BeansThis persistence is achieved by the use of Entity Beans Three Entity Beans:Three Entity Beans:
RuleDefRuleDef: stores every rule definition deployed: stores every rule definition deployed PlugInPlugIn: stores a set of instructions each plug-in understands and : stores a set of instructions each plug-in understands and
references to their implementing codereferences to their implementing code PlugInConfigurationPlugInConfiguration: stores a configuration pattern associated to : stores a configuration pattern associated to
every plug-in nameevery plug-in name
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2424
Message-driven BeansMessage-driven Beans
The Condition and Action services were The Condition and Action services were composed as Message-driven Beanscomposed as Message-driven Beans
Commonly MDBs are created declaratively but Commonly MDBs are created declaratively but we can not have a unique MDB to attend we can not have a unique MDB to attend all all the the possible rules and also we can not deploy possible rules and also we can not deploy beforehand a number beforehand a number n n of MDBs and assign of MDBs and assign each one a different rule to attendeach one a different rule to attend
Each condition and action services Each condition and action services must must be be deployed deployed dynamically dynamically every time a new rule is every time a new rule is registeredregistered
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2525
MDB Service ConfigurationMDB Service Configuration
RULE wayToWorkONIF
THEN
EngineStarted DriverIdentification = “Paul”
AND IsWorkingDay LoadDriverPreferences(”Paul”)
ECA-Manager
Concept
BasedJMS
ConditionMDB
J2EE Server
RULE wayToWorkONIF
THEN
EngineStarted DriverIdentification = “Paul”
AND IsWorkingDay LoadDriverPreferences(”Paul”)
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2626
MDB Class HierarchyMDB Class HierarchyThe Concept-based class hierarchy for the Message-driven beans servicesThe Concept-based class hierarchy for the Message-driven beans services
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2727
MDB Service Run-timeMDB Service Run-time
CActionMDB
JMS
Concept-basedMDB
CCondition
MDB
Concept-basedMDB
E CB
Interaction between the services and the concept-basedInteraction between the services and the concept-basedimplementation at run-timeimplementation at run-time
ACC
CB
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2828
OSGiOSGi OSGi is a lightweight framework for (remotely) deploying OSGi is a lightweight framework for (remotely) deploying
and executing service-oriented applicationsand executing service-oriented applications Oscar is an open source implementation of the OSGi Oscar is an open source implementation of the OSGi
specificationspecification OSGi works via dynamically loaded components, called OSGi works via dynamically loaded components, called
bundlesbundles Every bundle needs at least a Bundle Activator (to Every bundle needs at least a Bundle Activator (to
manage the life-cycle of every installed bundle) class manage the life-cycle of every installed bundle) class and a manifest fileand a manifest file
Commonly the steps required to create any bundle Commonly the steps required to create any bundle comprise:comprise:1.1. Write a bundle activator class in JavaWrite a bundle activator class in Java2.2. Create a Manifest file as a text fileCreate a Manifest file as a text file3.3. Build a JAR file that contains the compiled activator class the Build a JAR file that contains the compiled activator class the
Manifest file and any required libraryManifest file and any required library
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
2929
BundlesBundles
The following set of bundles was built, The following set of bundles was built, installed and shared:installed and shared:
• Inspector ServiceInspector Service• Web Form ServiceWeb Form Service
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
3030
Bundle OrganizationBundle Organization
RepositoryService
Concept-BasedNotification Service
Ontology.*
ActionService
Ontology.*
ConditionService
Ontology.*
ECAManagerService
Ontology.*
Imported packageExported packageProvided service Required service
EventCompositor
ConditionEvaluation
ActionExecution
Service Platform
3131
Using The Active Functionality Using The Active Functionality ServiceService
Event
3232
ConclusionsConclusions
The Active Functionality Service was extended:The Active Functionality Service was extended: Rule Definition APIRule Definition API
Web FormWeb Form Text ParserText Parser
Service Platform IndependenceService Platform Independence J2EEJ2EE OSGiOSGi Service logic and Functional logic separationService logic and Functional logic separation
J2EE: EJB 2.1 SpecificationJ2EE: EJB 2.1 Specification OSGi: Dynamic service assembleOSGi: Dynamic service assemble Static analysis of rulesStatic analysis of rules Run-time visualization toolsRun-time visualization tools Accommodate to real-time features where Accommodate to real-time features where
different performance tests can be applieddifferent performance tests can be applied Provide authoring and authentication in Provide authoring and authentication in
components and notification servicescomponents and notification services