Package org.jboss.gravia.runtime

Examples of org.jboss.gravia.runtime.ModuleActivator


            try {
                Boolean graviaEnabled = Boolean.parseBoolean(getHeaders().get(Constants.GRAVIA_ENABLED));
                String moduleActivatorName = getHeaders().get(Constants.MODULE_ACTIVATOR);
                String bundleActivatorName = getHeaders().get("Bundle-Activator");
                if (moduleActivatorName != null || bundleActivatorName != null) {
                    ModuleActivator moduleActivator;
                    synchronized (MODULE_ACTIVATOR_KEY) {
                        moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                        if (moduleActivator == null) {
                            if (moduleActivatorName != null) {
                                Object result = loadClass(moduleActivatorName).newInstance();
                                moduleActivator = (ModuleActivator) result;
                                putAttachment(MODULE_ACTIVATOR_KEY, moduleActivator);
                            } else if (bundleActivatorName != null && graviaEnabled) {
                                Object result = loadClass(bundleActivatorName).newInstance();
                                moduleActivator = new ModuleActivatorBridge((BundleActivator) result);
                                putAttachment(MODULE_ACTIVATOR_KEY, moduleActivator);
                            }
                        }
                    }
                    if (moduleActivator != null) {
                        moduleActivator.start(getModuleContext());
                    }
                }
            }

            // If the {@code ModuleActivator} is invalid or throws an exception then:
View Full Code Here


            eventHandler.fireModuleEvent(this, ModuleEvent.STOPPING);

            // #5 The {@link ModuleActivator#stop(ModuleContext)} is called
            Throwable stopException = null;
            try {
                ModuleActivator moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                if (moduleActivator != null) {
                    moduleActivator.stop(getModuleContext());
                }
            } catch (Throwable th) {
                stopException = th;
            }
View Full Code Here

            // #5 The {@link ModuleActivator#start(ModuleContext)} method if one is specified, is called.
            try {
                String className = getHeaders().get(Constants.MODULE_ACTIVATOR);
                if (className != null) {
                    ModuleActivator moduleActivator;
                    synchronized (MODULE_ACTIVATOR_KEY) {
                        moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                        if (moduleActivator == null) {
                            Object result = loadClass(className).newInstance();
                            moduleActivator = (ModuleActivator) result;
                            putAttachment(MODULE_ACTIVATOR_KEY, moduleActivator);
                        }
                    }
                    if (moduleActivator != null) {
                        moduleActivator.start(getModuleContext());
                    }
                }
            }

            // If the {@code ModuleActivator} is invalid or throws an exception then:
View Full Code Here

            eventHandler.fireModuleEvent(this, ModuleEvent.STOPPING);

            // #5 The {@link ModuleActivator#stop(ModuleContext)} is called
            Throwable stopException = null;
            try {
                ModuleActivator moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                if (moduleActivator != null) {
                    moduleActivator.stop(getModuleContext());
                }
            } catch (Throwable th) {
                stopException = th;
            }
View Full Code Here

            try {
                Boolean graviaEnabled = Boolean.parseBoolean(getHeaders().get(Constants.GRAVIA_ENABLED));
                String moduleActivatorName = getHeaders().get(Constants.MODULE_ACTIVATOR);
                String bundleActivatorName = getHeaders().get("Bundle-Activator");
                if (moduleActivatorName != null || bundleActivatorName != null) {
                    ModuleActivator moduleActivator;
                    synchronized (MODULE_ACTIVATOR_KEY) {
                        moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                        if (moduleActivator == null) {
                            if (moduleActivatorName != null) {
                                Object result = loadClass(moduleActivatorName).newInstance();
                                moduleActivator = (ModuleActivator) result;
                                putAttachment(MODULE_ACTIVATOR_KEY, moduleActivator);
                            } else if (bundleActivatorName != null && graviaEnabled) {
                                Object result = loadClass(bundleActivatorName).newInstance();
                                moduleActivator = new ModuleActivatorBridge((BundleActivator) result);
                                putAttachment(MODULE_ACTIVATOR_KEY, moduleActivator);
                            }
                        }
                    }
                    if (moduleActivator != null) {
                        moduleActivator.start(getModuleContext());
                    }
                }
            }

            // If the {@code ModuleActivator} is invalid or throws an exception then:
View Full Code Here

            eventHandler.fireModuleEvent(this, ModuleEvent.STOPPING);

            // #5 The {@link ModuleActivator#stop(ModuleContext)} is called
            Throwable stopException = null;
            try {
                ModuleActivator moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                if (moduleActivator != null) {
                    moduleActivator.stop(getModuleContext());
                }
            } catch (Throwable th) {
                stopException = th;
            }
View Full Code Here

            // #5 The {@link ModuleActivator#start(ModuleContext)} method if one is specified, is called.
            try {
                String className = getHeaders().get(Constants.MODULE_ACTIVATOR);
                if (className != null) {
                    ModuleActivator moduleActivator;
                    synchronized (MODULE_ACTIVATOR_KEY) {
                        moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                        if (moduleActivator == null) {
                            Object result = loadClass(className).newInstance();
                            moduleActivator = (ModuleActivator) result;
                            putAttachment(MODULE_ACTIVATOR_KEY, moduleActivator);
                        }
                    }
                    if (moduleActivator != null) {
                        moduleActivator.start(getModuleContext());
                    }
                }
            }

            // If the {@code ModuleActivator} is invalid or throws an exception then:
View Full Code Here

            eventHandler.fireModuleEvent(this, ModuleEvent.STOPPING);

            // #5 The {@link ModuleActivator#stop(ModuleContext)} is called
            Throwable stopException = null;
            try {
                ModuleActivator moduleActivator = getAttachment(MODULE_ACTIVATOR_KEY);
                if (moduleActivator != null) {
                    moduleActivator.stop(getModuleContext());
                }
            } catch (Throwable th) {
                stopException = th;
            }
View Full Code Here

TOP

Related Classes of org.jboss.gravia.runtime.ModuleActivator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.