diff --git a/cave/com.raytheon.uf.viz.common.core.feature/feature.xml b/cave/com.raytheon.uf.viz.common.core.feature/feature.xml
index 7791a0ca03..07d4a28f0b 100644
--- a/cave/com.raytheon.uf.viz.common.core.feature/feature.xml
+++ b/cave/com.raytheon.uf.viz.common.core.feature/feature.xml
@@ -63,13 +63,6 @@
version="0.0.0"
unpack="false"/>
-
- *
- * SOFTWARE HISTORY
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Aug 3, 2009 mschenke Initial creation
- *
- *
- *
- * @author mschenke
- * @version 1.0
- */
-
-public class RemoteDataStore implements IDataStore {
-
- private File file;
-
- private boolean useLocking;
-
- public RemoteDataStore(File file, boolean useLocking) {
- this.file = file;
- this.useLocking = useLocking;
- }
-
- @Override
- public String[] getDatasets(String group) throws StorageException,
- FileNotFoundException {
- ThriftDataRequest request = new ThriftDataRequest();
- request.setFile(file.getAbsolutePath());
- request.setUseLocking(useLocking);
- request.setMethod("getDatasets");
- request.setParameterTypes(new String[] { String.class.getName() });
- request.setParameters(new Object[] { group });
- try {
- ThriftDataResponse response = (ThriftDataResponse) ThriftClient
- .sendRequest(request);
- if (response.getDatasets() == null) {
- throw new VizException("response object was null");
- }
- return response.getDatasets();
- } catch (VizException e) {
- throw new StorageException("unable to retrieve data over http",
- null, e);
- }
- }
-
- @Override
- public IDataRecord[] retrieve(String group) throws StorageException,
- FileNotFoundException {
- ThriftDataRequest request = new ThriftDataRequest();
- request.setFile(file.getAbsolutePath());
- request.setUseLocking(useLocking);
- request.setMethod("retrieve");
- request.setParameterTypes(new String[] { String.class.getName() });
- request.setParameters(new Object[] { group });
- try {
- ThriftDataResponse response = (ThriftDataResponse) ThriftClient
- .sendRequest(request);
- if (response.getRecords() == null) {
- throw new VizException("response object was null");
- }
- return response.getRecords();
- } catch (VizException e) {
- throw new StorageException("unable to retrieve data over http",
- null, e);
- }
- }
-
- @Override
- public IDataRecord[] retrieve(String group, boolean includeInterpolated)
- throws StorageException, FileNotFoundException {
- ThriftDataRequest request = new ThriftDataRequest();
- request.setFile(file.getAbsolutePath());
- request.setUseLocking(useLocking);
- request.setMethod("retrieve");
- request.setParameterTypes(new String[] { String.class.getName(),
- boolean.class.getName() });
- request.setParameters(new Object[] { group, includeInterpolated });
- try {
- ThriftDataResponse response = (ThriftDataResponse) ThriftClient
- .sendRequest(request);
- if (response.getRecords() == null) {
- throw new VizException("response object was null");
- }
- return response.getRecords();
- } catch (VizException e) {
- throw new StorageException("unable to retrieve data over http",
- null, e);
- }
- }
-
- @Override
- public IDataRecord retrieve(String group, String dataset, Request request)
- throws StorageException, FileNotFoundException {
- ThriftDataRequest req = new ThriftDataRequest();
- req.setFile(file.getAbsolutePath());
- req.setUseLocking(useLocking);
- req.setMethod("retrieve");
- req.setParameterTypes(new String[] { String.class.getName(),
- String.class.getName(), Request.class.getName() });
- req.setParameters(new Object[] { group, dataset, request });
- try {
- ThriftDataResponse response = (ThriftDataResponse) ThriftClient
- .sendRequest(req);
- if (response.getRecord() == null) {
- throw new VizException("response object was null");
- }
- return response.getRecord();
- } catch (VizException e) {
- throw new StorageException("unable to retrieve data over http",
- null, e);
- }
- }
-
- @Override
- public IDataRecord[] retrieveDatasets(String[] datasetGroupPath,
- Request request) throws StorageException, FileNotFoundException {
- ThriftDataRequest req = new ThriftDataRequest();
- req.setFile(file.getAbsolutePath());
- req.setUseLocking(useLocking);
- req.setMethod("retrieveDatasets");
- req.setParameterTypes(new String[] { String[].class.getName(),
- Request.class.getName() });
- req.setParameters(new Object[] { datasetGroupPath, request });
- try {
- ThriftDataResponse response = (ThriftDataResponse) ThriftClient
- .sendRequest(req);
- if (response.getRecords() == null) {
- throw new VizException("response object was null");
- }
- return response.getRecords();
- } catch (VizException e) {
- throw new StorageException("unable to retrieve data over http",
- null, e);
- }
- }
-
- @Override
- public IDataRecord[] retrieveGroups(String[] groups, Request request)
- throws StorageException, FileNotFoundException {
- ThriftDataRequest req = new ThriftDataRequest();
- req.setFile(file.getAbsolutePath());
- req.setUseLocking(useLocking);
- req.setMethod("retrieveGroups");
- req.setParameterTypes(new String[] { String[].class.getName(),
- Request.class.getName() });
- req.setParameters(new Object[] { groups, request });
- try {
- ThriftDataResponse response = (ThriftDataResponse) ThriftClient
- .sendRequest(req);
- if (response.getRecords() == null) {
- throw new VizException("response object was null");
- }
- return response.getRecords();
- } catch (VizException e) {
- throw new StorageException("unable to retrieve data over http",
- null, e);
- }
- }
-
- @Override
- public void addDataRecord(IDataRecord dataset, StorageProperties properties)
- throws StorageException {
- throw new StorageException("Operation not supported", dataset);
- }
-
- @Override
- public void addDataRecord(IDataRecord dataset) throws StorageException {
- throw new StorageException("Operation not supported", dataset);
- }
-
- @Override
- public void delete(String... location) throws StorageException,
- FileNotFoundException {
- throw new StorageException("Operation not supported", null);
- }
-
- @Override
- public StorageStatus store() throws StorageException {
- throw new StorageException("Operation not supported", null);
- }
-
- @Override
- public StorageStatus store(StoreOp storeOp) throws StorageException {
- throw new StorageException("Operation not supported", null);
- }
-
- @Override
- public void createLinks(Map
- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Oct 12, 2010 mschenke Initial creation - * - *- * - * @author mschenke - * @version 1.0 - */ - -public class CustomOsgiApplicationContextCreator extends - DefaultOsgiApplicationContextCreator { - - /** logger */ - private static final Log log = LogFactory - .getLog(CustomOsgiApplicationContextCreator.class); - - private ConfigurationScanner configurationScanner = new DefaultConfigurationScanner(); - - public DelegatedExecutionOsgiBundleApplicationContext createApplicationContext( - BundleContext bundleContext) throws Exception { - Bundle bundle = bundleContext.getBundle(); - ApplicationContextConfiguration config = new ApplicationContextConfiguration( - bundle, configurationScanner); - if (log.isTraceEnabled()) - log.trace("Created configuration " + config + " for bundle " - + OsgiStringUtils.nullSafeNameAndSymName(bundle)); - - // it's not a spring bundle, ignore it - if (!config.isSpringPoweredBundle()) { - return null; - } - - log.info("Discovered configurations " - + ObjectUtils.nullSafeToString(config - .getConfigurationLocations()) + " in bundle [" - + OsgiStringUtils.nullSafeNameAndSymName(bundle) + "]"); - - DelegatedExecutionOsgiBundleApplicationContext sdoac = new CustomOsgiBundleXmlApplicationContext( - config.getConfigurationLocations()); - sdoac.setBundleContext(bundleContext); - sdoac.setPublishContextAsService(config.isPublishContextAsService()); - - return sdoac; - } - -} diff --git a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/ExtenderConfiguration.java b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/ExtenderConfiguration.java deleted file mode 100644 index b4dba761e4..0000000000 --- a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/ExtenderConfiguration.java +++ /dev/null @@ -1,577 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.viz.spring.dm; - -import java.io.UnsupportedEncodingException; -import java.net.URL; -import java.net.URLDecoder; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; -import java.util.Properties; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.context.event.SimpleApplicationEventMulticaster; -import org.springframework.core.JdkVersion; -import org.springframework.core.task.SimpleAsyncTaskExecutor; -import org.springframework.core.task.TaskExecutor; -import org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext; -import org.springframework.osgi.context.event.OsgiBundleApplicationContextEventMulticaster; -import org.springframework.osgi.context.event.OsgiBundleApplicationContextEventMulticasterAdapter; -import org.springframework.osgi.context.event.OsgiBundleApplicationContextListener; -import org.springframework.osgi.extender.OsgiApplicationContextCreator; -import org.springframework.osgi.extender.OsgiBeanFactoryPostProcessor; -import org.springframework.osgi.extender.OsgiServiceDependencyFactory; -import org.springframework.osgi.extender.internal.dependencies.startup.MandatoryImporterDependencyFactory; -import org.springframework.osgi.extender.internal.support.DefaultOsgiBundleApplicationContextListener; -import org.springframework.osgi.extender.internal.support.OsgiAnnotationPostProcessor; -import org.springframework.osgi.extender.support.internal.ConfigUtils; -import org.springframework.osgi.util.BundleDelegatingClassLoader; -import org.springframework.scheduling.timer.TimerTaskExecutor; -import org.springframework.util.Assert; -import org.springframework.util.ObjectUtils; - -/** - * TODO Add Description - * - *
- * - * Custom version of spring osgi ExtenderConfiguration to turn off xml validation - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Oct 12, 2010 mschenke Initial creation - * - *- * - * @author mschenke - * @version 1.0 - */ - -public class ExtenderConfiguration implements DisposableBean { - - /** logger */ - private static final Log log = LogFactory - .getLog(ExtenderConfiguration.class); - - private static final String TASK_EXECUTOR_NAME = "taskExecutor"; - - private static final String SHUTDOWN_TASK_EXECUTOR_NAME = "shutdownTaskExecutor"; - - private static final String CONTEXT_CREATOR_NAME = "applicationContextCreator"; - - private static final String APPLICATION_EVENT_MULTICASTER_BEAN_NAME = "osgiApplicationEventMulticaster"; - - private static final String CONTEXT_LISTENER_NAME = "osgiApplicationContextListener"; - - private static final String PROPERTIES_NAME = "extenderProperties"; - - private static final String SHUTDOWN_WAIT_KEY = "shutdown.wait.time"; - - private static final String PROCESS_ANNOTATIONS_KEY = "process.annotations"; - - private static final String WAIT_FOR_DEPS_TIMEOUT_KEY = "dependencies.wait.time"; - - private static final String EXTENDER_CFG_LOCATION = "META-INF/spring/extender"; - - private static final String XML_PATTERN = "*.xml"; - - private static final String ANNOTATION_DEPENDENCY_FACTORY = "org.springframework.osgi.extensions.annotation.ServiceReferenceDependencyBeanFactoryPostProcessor"; - - /** annotation processing system property (kept for backwards compatibility) */ - private static final String AUTO_ANNOTATION_PROCESSING = "org.springframework.osgi.extender.annotation.auto.processing"; - - // - // defaults - // - - // default dependency wait time (in milliseconds) - private static final long DEFAULT_DEP_WAIT = ConfigUtils.DIRECTIVE_TIMEOUT_DEFAULT * 1000; - - private static final long DEFAULT_SHUTDOWN_WAIT = 10 * 1000; - - private static final boolean DEFAULT_PROCESS_ANNOTATION = false; - - private ConfigurableOsgiBundleApplicationContext extenderConfiguration; - - private TaskExecutor taskExecutor, shutdownTaskExecutor; - - private boolean isTaskExecutorManagedInternally; - - private boolean isShutdownTaskExecutorManagedInternally; - - private boolean isMulticasterManagedInternally; - - private long shutdownWaitTime, dependencyWaitTime; - - private boolean processAnnotation; - - private OsgiBundleApplicationContextEventMulticaster eventMulticaster; - - private OsgiBundleApplicationContextListener contextEventListener; - - private boolean forceThreadShutdown; - - private OsgiApplicationContextCreator contextCreator; - - /** bundle wrapped class loader */ - private final ClassLoader classLoader; - - /** List of context post processors */ - private final List postProcessors = Collections - .synchronizedList(new ArrayList(0)); - - /** List of service dependency factories */ - private final List dependencyFactories = Collections - .synchronizedList(new ArrayList(0)); - - // fields reading/writing lock - private Object lock = new Object(); - - /** - * Constructs a new
ExtenderConfiguration
instance. Locates the
- * extender configuration, creates an application context which will
- * returned the extender items.
- *
- * @param bundleContext
- * extender OSGi bundle context
- */
- public ExtenderConfiguration(BundleContext bundleContext) {
- Bundle bundle = bundleContext.getBundle();
- Properties properties = new Properties(createDefaultProperties());
-
- Enumeration enm = bundle.findEntries(EXTENDER_CFG_LOCATION,
- XML_PATTERN, false);
-
- if (enm == null) {
- log.info("No custom extender configuration detected; using defaults...");
-
- synchronized (lock) {
- taskExecutor = createDefaultTaskExecutor();
- shutdownTaskExecutor = createDefaultShutdownTaskExecutor();
- eventMulticaster = createDefaultEventMulticaster();
- contextCreator = createDefaultApplicationContextCreator();
- contextEventListener = createDefaultApplicationContextListener();
-
- }
- classLoader = BundleDelegatingClassLoader
- .createBundleClassLoaderFor(bundle);
- } else {
- String[] configs = copyEnumerationToList(enm);
-
- log.info("Detected extender custom configurations at "
- + ObjectUtils.nullSafeToString(configs));
- // create OSGi specific XML context
- ConfigurableOsgiBundleApplicationContext extenderAppCtx = new CustomOsgiBundleXmlApplicationContext(
- configs);
- extenderAppCtx.setBundleContext(bundleContext);
- extenderAppCtx.refresh();
-
- synchronized (lock) {
- extenderConfiguration = extenderAppCtx;
- // initialize beans
- taskExecutor = extenderConfiguration
- .containsBean(TASK_EXECUTOR_NAME) ? (TaskExecutor) extenderConfiguration
- .getBean(TASK_EXECUTOR_NAME, TaskExecutor.class)
- : createDefaultTaskExecutor();
-
- shutdownTaskExecutor = extenderConfiguration
- .containsBean(SHUTDOWN_TASK_EXECUTOR_NAME) ? (TaskExecutor) extenderConfiguration
- .getBean(SHUTDOWN_TASK_EXECUTOR_NAME,
- TaskExecutor.class)
- : createDefaultShutdownTaskExecutor();
-
- eventMulticaster = extenderConfiguration
- .containsBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME) ? (OsgiBundleApplicationContextEventMulticaster) extenderConfiguration
- .getBean(
- APPLICATION_EVENT_MULTICASTER_BEAN_NAME,
- OsgiBundleApplicationContextEventMulticaster.class)
- : createDefaultEventMulticaster();
-
- contextCreator = extenderConfiguration
- .containsBean(CONTEXT_CREATOR_NAME) ? (OsgiApplicationContextCreator) extenderConfiguration
- .getBean(CONTEXT_CREATOR_NAME,
- OsgiApplicationContextCreator.class)
- : createDefaultApplicationContextCreator();
-
- contextEventListener = extenderConfiguration
- .containsBean(CONTEXT_LISTENER_NAME) ? (OsgiBundleApplicationContextListener) extenderConfiguration
- .getBean(CONTEXT_LISTENER_NAME,
- OsgiBundleApplicationContextListener.class)
- : createDefaultApplicationContextListener();
- }
-
- // get post processors
- postProcessors.addAll(extenderConfiguration.getBeansOfType(
- OsgiBeanFactoryPostProcessor.class).values());
-
- // get dependency factories
- dependencyFactories.addAll(extenderConfiguration.getBeansOfType(
- OsgiServiceDependencyFactory.class).values());
-
- classLoader = extenderConfiguration.getClassLoader();
- // extender properties using the defaults as backup
- if (extenderConfiguration.containsBean(PROPERTIES_NAME)) {
- Properties customProperties = (Properties) extenderConfiguration
- .getBean(PROPERTIES_NAME, Properties.class);
- Enumeration propertyKey = customProperties.propertyNames();
- while (propertyKey.hasMoreElements()) {
- String property = (String) propertyKey.nextElement();
- properties.setProperty(property,
- customProperties.getProperty(property));
- }
- }
- }
-
- synchronized (lock) {
- shutdownWaitTime = getShutdownWaitTime(properties);
- dependencyWaitTime = getDependencyWaitTime(properties);
- processAnnotation = getProcessAnnotations(properties);
- }
-
- // load default dependency factories
- addDefaultDependencyFactories();
- }
-
- /**
- * {@inheritDoc}
- *
- * Cleanup the configuration items.
- */
- public void destroy() {
-
- synchronized (lock) {
- if (isMulticasterManagedInternally) {
- eventMulticaster.removeAllListeners();
- eventMulticaster = null;
- }
-
- if (extenderConfiguration != null) {
- extenderConfiguration.close();
- extenderConfiguration = null;
- }
-
- // postpone the task executor shutdown
- if (forceThreadShutdown) {
-
- if (isTaskExecutorManagedInternally) {
- log.warn("Forcing the (internally created) taskExecutor to stop...");
- ThreadGroup th = ((SimpleAsyncTaskExecutor) taskExecutor)
- .getThreadGroup();
- if (!th.isDestroyed()) {
- // ask the threads nicely to stop
- th.interrupt();
- }
- }
- taskExecutor = null;
- }
-
- if (isShutdownTaskExecutorManagedInternally) {
- try {
- ((DisposableBean) shutdownTaskExecutor).destroy();
- } catch (Exception ex) {
- log.debug(
- "Received exception while shutting down shutdown task executor",
- ex);
- }
- shutdownTaskExecutor = null;
- }
- }
- }
-
- /**
- * Copies the URLs returned by the given enumeration and returns them as an
- * array of Strings for consumption by the application context.
- *
- * @param enm
- * @return
- */
- private String[] copyEnumerationToList(Enumeration enm) {
- List urls = new ArrayList(4);
- while (enm != null && enm.hasMoreElements()) {
- URL configURL = (URL) enm.nextElement();
- if (configURL != null) {
- String configURLAsString = configURL.toExternalForm();
- try {
- urls.add(URLDecoder.decode(configURLAsString, "UTF8"));
- } catch (UnsupportedEncodingException uee) {
- log.warn("UTF8 encoding not supported, using the platform default");
- urls.add(URLDecoder.decode(configURLAsString));
- }
- }
- }
-
- return (String[]) urls.toArray(new String[urls.size()]);
- }
-
- private Properties createDefaultProperties() {
- Properties properties = new Properties();
- properties.setProperty(SHUTDOWN_WAIT_KEY, "" + DEFAULT_SHUTDOWN_WAIT);
- properties.setProperty(PROCESS_ANNOTATIONS_KEY, ""
- + DEFAULT_PROCESS_ANNOTATION);
- properties
- .setProperty(WAIT_FOR_DEPS_TIMEOUT_KEY, "" + DEFAULT_DEP_WAIT);
-
- return properties;
- }
-
- private void addDefaultDependencyFactories() {
- boolean debug = log.isDebugEnabled();
-
- // default JDK 1.4 processor
- dependencyFactories.add(0, new MandatoryImporterDependencyFactory());
-
- // load through reflection the dependency and injection processors if
- // running on JDK 1.5 and annotation processing is enabled
- if (processAnnotation) {
- if (JdkVersion.isAtLeastJava15()) {
- // dependency processor
- Class annotationProcessor = null;
- try {
- annotationProcessor = Class.forName(
- ANNOTATION_DEPENDENCY_FACTORY, false,
- ExtenderConfiguration.class.getClassLoader());
- } catch (ClassNotFoundException cnfe) {
- log.warn(
- "Spring DM annotation package not found, annotation processing disabled.",
- cnfe);
- return;
- }
- Object processor = BeanUtils
- .instantiateClass(annotationProcessor);
- Assert.isInstanceOf(OsgiServiceDependencyFactory.class,
- processor);
- dependencyFactories.add(1,
- (OsgiServiceDependencyFactory) processor);
-
- if (debug)
- log.debug("Succesfully loaded annotation dependency processor ["
- + ANNOTATION_DEPENDENCY_FACTORY + "]");
-
- // add injection processor (first in line)
- postProcessors.add(0, new OsgiAnnotationPostProcessor());
- log.info("Spring-DM annotation processing enabled");
- } else {
- if (debug)
- log.debug("JDK 5 not available ["
- + ANNOTATION_DEPENDENCY_FACTORY + "] not loaded");
- log.warn("Spring-DM annotation processing enabled but JDK 5 is n/a; disabling annotation processing...");
- }
- } else {
- if (debug) {
- log.debug("Spring-DM annotation processing disabled; ["
- + ANNOTATION_DEPENDENCY_FACTORY + "] not loaded");
- }
- }
-
- }
-
- private TaskExecutor createDefaultTaskExecutor() {
- // create thread-pool for starting contexts
- ThreadGroup threadGroup = new ThreadGroup("spring-osgi-extender["
- + ObjectUtils.getIdentityHexString(this) + "]-threads");
- threadGroup.setDaemon(false);
-
- SimpleAsyncTaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
- taskExecutor.setThreadGroup(threadGroup);
- taskExecutor.setThreadNamePrefix("SpringOsgiExtenderThread-");
-
- isTaskExecutorManagedInternally = true;
-
- return taskExecutor;
- }
-
- private TaskExecutor createDefaultShutdownTaskExecutor() {
- TimerTaskExecutor taskExecutor = new TimerTaskExecutor();
- taskExecutor.afterPropertiesSet();
- isShutdownTaskExecutorManagedInternally = true;
- return taskExecutor;
- }
-
- private OsgiBundleApplicationContextEventMulticaster createDefaultEventMulticaster() {
- isMulticasterManagedInternally = true;
- return new OsgiBundleApplicationContextEventMulticasterAdapter(
- new SimpleApplicationEventMulticaster());
- }
-
- private OsgiApplicationContextCreator createDefaultApplicationContextCreator() {
- return new CustomOsgiApplicationContextCreator();
- }
-
- private OsgiBundleApplicationContextListener createDefaultApplicationContextListener() {
- return new DefaultOsgiBundleApplicationContextListener();
- }
-
- private long getShutdownWaitTime(Properties properties) {
- return Long.parseLong(properties.getProperty(SHUTDOWN_WAIT_KEY));
- }
-
- private long getDependencyWaitTime(Properties properties) {
- return Long
- .parseLong(properties.getProperty(WAIT_FOR_DEPS_TIMEOUT_KEY));
- }
-
- private boolean getProcessAnnotations(Properties properties) {
- return Boolean.valueOf(properties.getProperty(PROCESS_ANNOTATIONS_KEY))
- .booleanValue()
- || Boolean.getBoolean(AUTO_ANNOTATION_PROCESSING);
- }
-
- /**
- * Returns the taskExecutor.
- *
- * @return Returns the taskExecutor
- */
- public TaskExecutor getTaskExecutor() {
- synchronized (lock) {
- return taskExecutor;
- }
- }
-
- /**
- * Returns the shutdown task executor.
- *
- * @return Returns the shutdown task executor
- */
- public TaskExecutor getShutdownTaskExecutor() {
- synchronized (lock) {
- return shutdownTaskExecutor;
- }
- }
-
- /**
- * Returns the contextEventListener.
- *
- * @return Returns the contextEventListener
- */
- public OsgiBundleApplicationContextListener getContextEventListener() {
- synchronized (lock) {
- return contextEventListener;
- }
- }
-
- /**
- * Returns the shutdownWaitTime.
- *
- * @return Returns the shutdownWaitTime
- */
- public long getShutdownWaitTime() {
- synchronized (lock) {
- return shutdownWaitTime;
- }
- }
-
- /**
- * Indicates if the process annotation is enabled or not.
- *
- * @return Returns true if the annotation should be processed or not
- * otherwise.
- */
- public boolean shouldProcessAnnotation() {
- synchronized (lock) {
- return processAnnotation;
- }
- }
-
- /**
- * Returns the dependencyWaitTime.
- *
- * @return Returns the dependencyWaitTime
- */
- public long getDependencyWaitTime() {
- synchronized (lock) {
- return dependencyWaitTime;
- }
- }
-
- /**
- * Returns the eventMulticaster.
- *
- * @return Returns the eventMulticaster
- */
- public OsgiBundleApplicationContextEventMulticaster getEventMulticaster() {
- synchronized (lock) {
- return eventMulticaster;
- }
- }
-
- /**
- * Sets the flag to force the taskExtender to close up in case of runaway
- * threads - this applies *only* if the taskExecutor has been created
- * internally.
- *
- *
- * The flag will cause a best attempt to shutdown the threads.
- *
- * @param forceThreadShutdown
- * The forceThreadShutdown to set.
- */
- public void setForceThreadShutdown(boolean forceThreadShutdown) {
- synchronized (lock) {
- this.forceThreadShutdown = forceThreadShutdown;
- }
- }
-
- /**
- * Returns the contextCreator.
- *
- * @return Returns the contextCreator
- */
- public OsgiApplicationContextCreator getContextCreator() {
- synchronized (lock) {
- return contextCreator;
- }
- }
-
- /**
- * Returns the postProcessors.
- *
- * @return Returns the postProcessors
- */
- public List getPostProcessors() {
- return postProcessors;
- }
-
- /**
- * Returns the class loader wrapped around the extender bundle.
- *
- * @return extender bundle class loader
- */
- public ClassLoader getClassLoader() {
- return classLoader;
- }
-
- /**
- * Returns the dependencies factories declared by the extender
- * configuration. The list automatically contains the default listeners
- * (such as the annotation one).
- *
- * @return list of dependency factories
- */
- public List getDependencyFactories() {
- return dependencyFactories;
- }
-}
diff --git a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/ListListenerAdapter.java b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/ListListenerAdapter.java
deleted file mode 100644
index d51400b57a..0000000000
--- a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/ListListenerAdapter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.uf.viz.spring.dm;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.springframework.osgi.context.event.OsgiBundleApplicationContextEvent;
-import org.springframework.osgi.context.event.OsgiBundleApplicationContextListener;
-import org.springframework.util.Assert;
-
-/**
- * Direct copy of
- * org.springframework.osgi.extender.internal.activator.ListListenerAdapter.
- * Needed for copy of ContextLoaderListener (Activator) since spring class is
- * package level visibility only
- *
- * - * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Oct 12, 2010 mschenke Initial creation - * - *- * - * @author mschenke - * @version 1.0 - */ - -class ListListenerAdapter implements OsgiBundleApplicationContextListener { - - private final List listeners; - - /** - * Constructs a new
ListListenerAdapter
instance.
- *
- * @param listeners
- */
- public ListListenerAdapter(List listeners) {
- Assert.notNull(listeners);
- this.listeners = listeners;
- }
-
- public void onOsgiApplicationEvent(OsgiBundleApplicationContextEvent event) {
- for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
- OsgiBundleApplicationContextListener osgiListener = (OsgiBundleApplicationContextListener) iterator
- .next();
- osgiListener.onOsgiApplicationEvent(event);
- }
- }
-}
diff --git a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIGroupApplicationContext.java b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIGroupApplicationContext.java
new file mode 100644
index 0000000000..0396b29a7c
--- /dev/null
+++ b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIGroupApplicationContext.java
@@ -0,0 +1,62 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.viz.spring.dm;
+
+import java.util.List;
+
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.context.support.GenericApplicationContext;
+
+/**
+ * OSGI Group application context, constructs an {@link OSGIGroupBeanFactory}
+ * from the context group's factories
+ *
+ * + * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Nov 1, 2012 mschenke Initial creation + * + *+ * + * @author mschenke + * @version 1.0 + */ + +public class OSGIGroupApplicationContext extends GenericApplicationContext { + + public OSGIGroupApplicationContext( + List
* @@ -31,7 +33,7 @@ import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 12, 2010 mschenke Initial creation + * Oct 30, 2012 mschenke Initial creation * ** @@ -39,23 +41,32 @@ import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; * @version 1.0 */ -public class CustomOsgiBundleXmlApplicationContext extends - OsgiBundleXmlApplicationContext { +public class OSGIXmlApplicationContext extends AbstractXmlApplicationContext { - /** - * @param configs - */ - public CustomOsgiBundleXmlApplicationContext(String[] configs) { - super(configs); + public OSGIXmlApplicationContext(String[] configLocations, Bundle bundle) { + this(null, configLocations, bundle); } + public OSGIXmlApplicationContext(ApplicationContext parent, + String[] configLocations, Bundle bundle) { + super(parent); + setClassLoader(new OSGIXmlClassLoader(bundle, getClassLoader())); + setConfigLocations(configLocations); + refresh(); + } + + /* + * (non-Javadoc) + * + * @see org.springframework.context.support.AbstractXmlApplicationContext# + * initBeanDefinitionReader + * (org.springframework.beans.factory.xml.XmlBeanDefinitionReader) + */ @Override protected void initBeanDefinitionReader( XmlBeanDefinitionReader beanDefinitionReader) { super.initBeanDefinitionReader(beanDefinitionReader); - beanDefinitionReader - .setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE); - beanDefinitionReader.setNamespaceAware(true); + beanDefinitionReader.setBeanClassLoader(getClassLoader()); } } diff --git a/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIXmlClassLoader.java b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIXmlClassLoader.java new file mode 100644 index 0000000000..a7997b74b8 --- /dev/null +++ b/cave/com.raytheon.uf.viz.spring.dm/src/com/raytheon/uf/viz/spring/dm/OSGIXmlClassLoader.java @@ -0,0 +1,68 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.spring.dm; + +import org.osgi.framework.Bundle; + +/** + * + * Class loader for spring bundle context + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Nov 6, 2012 mschenke Initial creation + * + *+ * + * @author mschenke + * @version 1.0 + */ + +public class OSGIXmlClassLoader extends ClassLoader { + + private Bundle bundle; + + public OSGIXmlClassLoader(Bundle bundle, ClassLoader parent) { + super(parent); + this.bundle = bundle; + } + + @Override + protected synchronized Class> loadClass(String name, boolean resolve) + throws ClassNotFoundException { + Class> clazz = null; + try { + clazz = super.loadClass(name, resolve); + } catch (ClassNotFoundException e) { + // Ignore here + } + + if (clazz == null) { + clazz = bundle.loadClass(name); + } + + return clazz; + } + +} diff --git a/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/MenuUpdater.java b/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/MenuUpdater.java index ea7c8f1c22..64aee9f6b1 100644 --- a/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/MenuUpdater.java +++ b/cave/com.raytheon.viz.alerts/src/com/raytheon/viz/alerts/jobs/MenuUpdater.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.viz.core.alerts.AlertMessage; import com.raytheon.uf.viz.core.rsc.URICatalog; @@ -47,11 +46,6 @@ import com.raytheon.viz.alerts.IAlertObserver; */ public class MenuUpdater implements IAlertObserver { - public MenuUpdater() { - // TODO remove following line once Util removes static block - Util.getCurrentMemory(); - } - /* * (non-Javadoc) * diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/Activator.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/Activator.java index 34ab54357c..b90d13076b 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/Activator.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/Activator.java @@ -22,10 +22,6 @@ package com.raytheon.viz.grid; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.raytheon.uf.common.dataplugin.convert.ConvertUtil; -import com.raytheon.uf.common.gridcoverage.GridCoverage; -import com.raytheon.uf.common.gridcoverage.convert.GridCoverageConverter; - /** * The activator class controls the plug-in life cycle */ @@ -53,8 +49,6 @@ public class Activator extends AbstractUIPlugin { */ public void start(BundleContext context) throws Exception { super.start(context); - ConvertUtil.registerConverter(new GridCoverageConverter(), - GridCoverage.class); } /* diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java index 25b0953da5..227c654343 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import com.raytheon.edex.util.Util; import com.raytheon.uf.common.comm.CommunicationException; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.grid.GridConstants; @@ -134,8 +133,6 @@ public class GridUpdater implements IAlertObserver { private Map
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Aug 3, 2009 mschenke Initial creation - * - *- * - * @author mschenke - * @version 1.0 - */ - -public class RetrieveDataHandler implements IRequestHandler
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Aug 3, 2009 mschenke Initial creation - * - *- * - * @author mschenke - * @version 1.0 - */ -@DynamicSerialize -public class ThriftDataRequest implements IServerRequest { - - @DynamicSerializeElement - private Object[] parameters; - - @DynamicSerializeElement - private String[] parameterTypes; - - @DynamicSerializeElement - private String file; - - @DynamicSerializeElement - private String method; - - @DynamicSerializeElement - private boolean useLocking; - - public Object[] getParameters() { - return parameters; - } - - public void setParameters(Object[] parameters) { - this.parameters = parameters; - } - - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public boolean isUseLocking() { - return useLocking; - } - - public void setUseLocking(boolean useLocking) { - this.useLocking = useLocking; - } - - public String[] getParameterTypes() { - return parameterTypes; - } - - /** - * Sets the parameter types, these types are turned into classes using - * Class.forName on the server side. Needed for reflective method invocation - * - * @param parameterTypes - * should match up 1-1 with parameters - */ - public void setParameterTypes(String[] parameterTypes) { - this.parameterTypes = parameterTypes; - } - -} diff --git a/edexOsgi/com.raytheon.uf.common.datastorage.remote/src/com/raytheon/uf/common/datastorage/remote/requests/ThriftDataResponse.java b/edexOsgi/com.raytheon.uf.common.datastorage.remote/src/com/raytheon/uf/common/datastorage/remote/requests/ThriftDataResponse.java deleted file mode 100644 index 5d1fb6a27a..0000000000 --- a/edexOsgi/com.raytheon.uf.common.datastorage.remote/src/com/raytheon/uf/common/datastorage/remote/requests/ThriftDataResponse.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.common.datastorage.remote.requests; - -import com.raytheon.uf.common.datastorage.records.IDataRecord; -import com.raytheon.uf.common.serialization.ISerializableObject; -import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; -import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; - -/** - * Data response object - * - *
- * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Aug 18, 2009 mschenke Initial creation - * - *- * - * @author mschenke - * @version 1.0 - */ -@DynamicSerialize -public class ThriftDataResponse implements ISerializableObject { - - @DynamicSerializeElement - private String[] datasets; - - @DynamicSerializeElement - private IDataRecord[] records; - - @DynamicSerializeElement - private IDataRecord record; - - public ThriftDataResponse() { - - } - - public ThriftDataResponse(String[] datsets) { - this.datasets = datsets; - } - - public ThriftDataResponse(IDataRecord[] records) { - this.records = records; - } - - public ThriftDataResponse(IDataRecord record) { - this.record = record; - } - - public String[] getDatasets() { - return datasets; - } - - public void setDatasets(String[] datasets) { - this.datasets = datasets; - } - - public IDataRecord[] getRecords() { - return records; - } - - public void setRecords(IDataRecord[] records) { - this.records = records; - } - - public IDataRecord getRecord() { - return record; - } - - public void setRecord(IDataRecord record) { - this.record = record; - } - -} diff --git a/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF index 8f6a0bee35..6728fad0a0 100644 --- a/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.common.geospatial/META-INF/MANIFEST.MF @@ -14,11 +14,12 @@ Require-Bundle: org.geotools;bundle-version="2.5.2";visibility:=reexport, org.apache.commons.beanutils;bundle-version="1.8.3", com.raytheon.uf.common.serialization;bundle-version="1.12.1174", com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174", - com.raytheon.uf.common.dataquery;bundle-version="1.0.0" + com.raytheon.uf.common.dataquery;bundle-version="1.0.0", + com.raytheon.uf.common.status;bundle-version="1.12.1174", + com.raytheon.uf.common.util;bundle-version="1.12.1174" Export-Package: com.raytheon.uf.common.geospatial, com.raytheon.uf.common.geospatial.interpolation, com.raytheon.uf.common.geospatial.interpolation.data, com.raytheon.uf.common.geospatial.request, com.raytheon.uf.common.geospatial.spi, com.raytheon.uf.common.geospatial.util -Import-Package: com.raytheon.uf.common.status diff --git a/edexOsgi/com.raytheon.uf.common.geospatial/build.properties b/edexOsgi/com.raytheon.uf.common.geospatial/build.properties index 34d2e4d2da..5791d48d5f 100644 --- a/edexOsgi/com.raytheon.uf.common.geospatial/build.properties +++ b/edexOsgi/com.raytheon.uf.common.geospatial/build.properties @@ -1,4 +1,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + res/ diff --git a/edexOsgi/com.raytheon.uf.common.geospatial/component-deploy.xml b/edexOsgi/com.raytheon.uf.common.geospatial/component-deploy.xml deleted file mode 100644 index b75ce2262e..0000000000 --- a/edexOsgi/com.raytheon.uf.common.geospatial/component-deploy.xml +++ /dev/null @@ -1,8 +0,0 @@ -