YourKit Java Profiler |
JFacets /
ArchitectureJFacets uses several components (wired together using Spring) to make the whole thing work, and keep it fully extensible. Here under is the global architecture of the framework : ![]() Let's describe the components involved... JFacetsThis is the top-level class used at run-time for retrieving and executing facets. It encapsulates the internals of the framework, and exposes a simple API. In most of the cases, you will only deal with this one when writing code that uses facets. You don't have to change anything in there or extend something : this component is already functional and you don't need to replace it in the Spring context. FacetRepositoryThis component handles most of the stuff (using sub-components) :
It's implemented in the FacetDescriptorManagerThe FacetDescriptorManager ( Some variants of this component are already provided for different use cases (pure Java facets, Groovy facets or both), which should be sufficient for usual situations. Nevertheless, it can be configured via the Spring ApplicationContext, and you could implement your own FacetDescriptorManager for handling additional stuff if you need. FacetFactoryFacetFactories are responsible of creating facet instances. They must implement the One again, JFacets ships with default implementations that uses FacetContext and FacetContextFactoryThe FacetContext (defined by the interface When a facet is created, the FacetRepository also creates a FacetContext and passes it to the facet before it's returned to the caller. FacetContextFactories are reponsible of creating FacetContexts. The FacetContextFactory is defined in the Spring context, and injected into the FacetRepository so that this one can create the contexts and pass them to created facets. JFacets ships with a default implementation of the FacetContextFactory, and you probably won't need to change this. Anyway, in some circumstances (if you want to add things to the context), you may need to do so. Then just implement the ProfileRepositoryThe ProfileRepository is the component that encapsulates management of users, roles etc. and abstracts all this as a navigable graph of profiles. It's an adapter for your own stuff that allows JFacets to know about the hierarchical structure of your users, roles etc. This component must be implemented by developers in order to wrap the user management mechanisms and make them available as JFacets profiles. You also have to provide the class name of your ProfileRepository in the Spring context : <bean id="profileRepository" singleton="true" class="net.sourceforge.jfacets.simpleprofiles.SimpleProfileRepository"> </bean> Have a look here for more infos about the ProfileRepository. |