Docstoc

aspectfilter.ppt - Department of Computer Science and Engineering

Document Sample
aspectfilter.ppt - Department of Computer Science and Engineering Powered By Docstoc
					 AspectJ Based Implementation of
  Dynamically Pluggable Filter
      Objects in Distributed
          Environment

      Rushikesh K. Joshi, Neeraj Agrawal
Department of Computer Science and Engineering
 Indian Institute of Technology Bombay, India

             Contact: Rkj@cse.iitb.ac.in
The Filter Object Model based on
  Interclass Filter Relationship

                       another


             bounce
                           upfilter
                                      pass
  server.m                                    m ()
              return
                       downfilter
  client                                     server
                        afilter
Modeling an Interclass Filter
       Relationship
              ser
    AClient         SearchBase
                    search ()
 remote ()




                        Cache
                     upFilter() |
                     search()

                    downFilter() |
                    search()
Modeling an Inter-instance Filter
Relationship: A Dynamic State

               ser
trans:Client                 sb:SearchBase




         logger:Log   cache:Cache
     Properties of Filter Objects
• Filter Object Specification decoupled from
  Client/Server class specifications
• Filter Objects are instance of classes
• Transparency: client and server code unaware of
  filter objects
• Filtering of upward and downward messages
• Dynamic Pluggability: specify, create, plug,
  reconfigure at runtime
• Chaining and Grouping
  Key Features of the AspectJ
Implementation of Filter Objects
• An Aspect specification - To model filter objects
• Calls delegated to a filter pipe – pointcuts and
  around advice
• Filter Pipe - Organizes the chain of filter objects,
  which may themselves be distributed
   – Filter pipe is a remotely available object
   – Maintains Mappings from client-server pairs to vectors
     of filter objects (upfilters and downfilters)
                 The Solution

        Aspect                    FilterObject

                                 upFilter1 ()
                               downFilter1 () ..


FilterObjectN          FilterObject1
                                                    FilterPipe
 upFilter1 ()
                …..    upFilter1 ()
                                                   upFilter1 ()     FOs
                                                 downFilter1 (..)
downFilter1()         downFilter1()

                                                    For all f in FOs
                                                     f->upFilter()
        Development Process
• Base Code  Filter Class Abstraction 
  Base Code Compilation with Abstraction
  (needed if environment is not ‘filter aware’)
   Base Code in execution  Filter Object
  Development may be developed as late as
  this point after their abstraction is known 
  Inject filters into the system, reconfigure as
  programmed for
      A Server Implementation
Class CSearch implements ISearch extends
   UnicastRemoteObject {
   String search (String query);
}
Class SearchFactory {
   .. main () {
   …create and bind a CSearch component …
  CSearch is a remotely available object
}}
        A FilterPipe Implementation
Class CSearchFilterPipe implements ISearchFilterPipe
  extends UnicastRemoteObject{
  static vector upFilterVector = new Vector;
  static vector downFilterVector = new Vector;
  boolean searchUp (..)…go through all upfilters if earlier
                          not bounced …
  void searchDown (..) .. Go through all downfilters …
}
FilterPipeFactory creates and binds a filterpipe
Filter pipe holds filter objects
Implementation of Filter Objects
Class Replacer implements ISearchFilter {
  Boolean searchUp (..)…
  searchDown (..)…
}
Class Repeater implements ISearchFilter {
  …..
}
      Implementing the client
Class SearchClient {
  ..main (..) {
            …lookup and bind to intended
                server…
            …invoke desired methods...
}
            The Aspect Code
aspect SearchAspect {
  ISearchFilterPipe seFp; …
      .. pointcut on search call/execution..
      around advice on search call {
             …lookup and bind to filter pipe..
             …call upfilter member on filter pipe..
             …if not bounced, proceed to intended
                server..
             …call downfilter member on filter pipe…
             return result
      }
}
     Filter Binding Types



 One-to-One         One-to-Many




Many-to-One         Many-to-Many
         Typical Deployments
• One-to-One                     Client Side/Server Side
         – Low network overhead
• One-to-Many                    Client Side
         – Client side deployment more efficient since all filtered messages
           originate from one client
• May-to-One                     Server Side
         – Server side deployment more efficient since all filter messages
           are against one server


• Many-to-Many                   Possibly on an Independent
                                 Machine
         – Depends on network overheads, load
• Per Class/Per Object/Per Machine Filter Pipes
                 Conclusions
• Proposed a scheme for implementation of
  dynamically pluggable and distributed Filter
  Objects on top of AspectJ
• Requires base code to be filter aware when in
  execution
• Supports rich possibilities of configuring filter
  objects
• Brought out the need for a careful selection of a
  Deployment Strategy
Issues put forward for Discussion
• Is the requirement of Filter Aware Base Code a
  desirable property?
   – Consider Static vs. dynamic awareness
• Is there an advantage in turning Programming
  Environments themselves Filter Aware
• What is the right granularity of filter specifications
  and is there synthesis? – per process, per object,
  per message, per machine, per class, per client
  ..chains,groups..
• Is there separation of high level abstractions of
  filters from their low level generalizations? How
  efficient can the mappings from former to latter
  be?

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:5/11/2013
language:English
pages:17