org.richfaces.application
Class ServiceTracker

java.lang.Object
  extended by org.richfaces.application.ServiceTracker

public final class ServiceTracker
extends Object

Tracker class to provide access to various framework implementation services. Examples of such services are: SkinFactory, TBD.

Supports JSR-330 dependency injection.

This class represents application-scoped object that is stored in the map with Thread.currentThread() Context classloader. Therefore, there is only one instance perr JEE application in the current JVM.

Note: in initial state this class is not synchronized and presumes that all modification operations are done in a context of single-thread (in JSF initialization listener).

Since:
4.0
Author:
Nick Belaevski

Method Summary
static
<T> T
getService(Class<T> target)
           
static
<T> T
getService(javax.faces.context.FacesContext context, Class<T> target)
           
static void release()
          

Remove dependency injection service associated with current context.

static void setFactory(ServicesFactory factory)
          

Set dependency injection service implementation.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getService

public static <T> T getService(Class<T> target)

getService

public static <T> T getService(javax.faces.context.FacesContext context,
                               Class<T> target)

setFactory

public static void setFactory(ServicesFactory factory)

Set dependency injection service implementation.

Parameters:
factory -

release

public static void release()

Remove dependency injection service associated with current context.



Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.