...
Integrating Web UI Frameworks
XXXXXXXXApplications may require a UI. Fabric3 supports bundling UI frameworks as part of a WAR deployment. In this case, it is often necessary to provide the UI framework with references to Fabric3 services that can be invoked during request processing. UI frameworks typically provide extension points to integrate third-party component frameworks. These extension points can be used in conjunction with the Fabric3 Node API as defined in the org.fabric3:fabric-node-api
module. For example, a service resolver for a UI framework can be implemented using the Fabric3 Node API as follows:
Code Block | ||||
---|---|---|---|---|
| ||||
public T resolve(Class<T> serviceType) {
Object proxy = CACHE.get(serviceType);
if (proxy == null) {
ClassLoader loader = getClass().getClassLoader();
// get the Fabric3 service proxy and cache it
proxy = Bootstrap.initialize().getDomain().getService(serviceType);
CACHE.put(serviceType, proxy);
}
return proxy;
} |
Enabling Web Component Support
...