Issue #1308 Wrote custom OSGI spring handler that could support multiple XML contexts per bundle, merge dependency contexts and scan res spring folder like EDEX. Two changes were required, one for menu generation registration and one for apache beanutils converter registration.
Change-Id: If392126da6b7b27be20bbcb2423ab0e851307345 Former-commit-id:ca4177dd08
[formerly a9c7374d162296c170f7c1b80e1fb2978b854cfd] Former-commit-id:2f90120248
This commit is contained in:
parent
ec86e24f71
commit
f069f34a96
124 changed files with 457 additions and 2608 deletions
|
@ -63,13 +63,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.datastorage.remote"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.derivparam"
|
||||
download-size="0"
|
||||
|
@ -88,8 +81,13 @@
|
|||
id="com.raytheon.uf.common.geospatial"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.units"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.localization"
|
||||
|
@ -172,8 +170,7 @@
|
|||
id="com.raytheon.uf.common.time"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.topo"
|
||||
|
|
|
@ -103,8 +103,7 @@
|
|||
id="com.raytheon.uf.common.gridcoverage"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.dataplugin.grid"
|
||||
|
@ -182,13 +181,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.viz.datastorage.remote"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.viz.spellchecker"
|
||||
download-size="0"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
|
||||
|
||||
<bean id="httpClient" class="com.raytheon.uf.common.comm.HttpClient" factory-method="getInstance">
|
||||
<property name="socketTimeout" value="330000"/>
|
||||
<property name="connectionTimeout" value="10000"/>
|
|
@ -309,12 +309,6 @@
|
|||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="org.springframework.dm"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.sun.jna"
|
||||
download-size="0"
|
||||
|
|
|
@ -178,4 +178,11 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.edex.plugin.binlightning"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#Mon Aug 03 13:10:34 CDT 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -1,12 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Thrift Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.viz.datastorage.remote
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: com.raytheon.uf.common.datastorage;bundle-version="1.11.12",
|
||||
com.raytheon.uf.common.datastorage.remote;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.11.12"
|
||||
Export-Package: com.raytheon.uf.viz.datastorage.remote
|
|
@ -1,259 +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.datastorage.remote;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.StorageException;
|
||||
import com.raytheon.uf.common.datastorage.StorageProperties;
|
||||
import com.raytheon.uf.common.datastorage.StorageProperties.Compression;
|
||||
import com.raytheon.uf.common.datastorage.StorageStatus;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.remote.requests.ThriftDataRequest;
|
||||
import com.raytheon.uf.common.datastorage.remote.requests.ThriftDataResponse;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
|
||||
/**
|
||||
* Creates RetrieveDataRequests and sends them to the edex server.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 3, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @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<String, LinkLocation> links)
|
||||
throws StorageException, FileNotFoundException {
|
||||
throw new StorageException("Operation not supported", null);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFiles(String[] datesToDelete) throws StorageException,
|
||||
FileNotFoundException {
|
||||
throw new StorageException("Operation not supported", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createDataset(IDataRecord rec) throws StorageException,
|
||||
FileNotFoundException {
|
||||
throw new StorageException("Operation not supported", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void repack(Compression compression) throws StorageException {
|
||||
throw new StorageException("Operation not supported", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copy(String outputDir, Compression compression,
|
||||
String timestampCheck, int minMillisSinceLastChange,
|
||||
int maxMillisSinceLastChange) throws StorageException {
|
||||
throw new StorageException("Operation not supported", null);
|
||||
}
|
||||
|
||||
}
|
|
@ -199,8 +199,7 @@
|
|||
id="com.raytheon.uf.common.time"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.edex.common"
|
||||
|
@ -290,8 +289,7 @@
|
|||
id="com.raytheon.uf.common.geospatial"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.pointdata"
|
||||
|
@ -428,12 +426,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.springframework.dm"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="1.2.1"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.edex.core"
|
||||
download-size="0"
|
||||
|
|
|
@ -51,7 +51,7 @@ Developed on the Raytheon Visualization Environment (viz)
|
|||
</features>
|
||||
|
||||
<configurations>
|
||||
<plugin id="com.raytheon.uf.viz.spring.dm" autoStart="true" startLevel="5" />
|
||||
<plugin id="com.raytheon.uf.viz.spring.dm" autoStart="true" startLevel="0" />
|
||||
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
|
||||
</configurations>
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ Bundle-Activator: com.raytheon.uf.viz.spring.dm.Activator
|
|||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.springframework;bundle-version="2.5.6",
|
||||
org.apache.commons.logging;bundle-version="1.1.1",
|
||||
org.springframework.dm;bundle-version="1.2.1"
|
||||
org.apache.commons.logging;bundle-version="1.1.1"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
instructions.configure = \
|
||||
setStartLevel(startLevel:5);\
|
||||
setStartLevel(startLevel:0);\
|
||||
markStarted(started: true);
|
|
@ -1,48 +1,21 @@
|
|||
package com.raytheon.uf.viz.spring.dm;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Timer;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.BundleEvent;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.framework.SynchronousBundleListener;
|
||||
import org.osgi.framework.Version;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.core.CollectionFactory;
|
||||
import org.springframework.core.task.SyncTaskExecutor;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext;
|
||||
import org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext;
|
||||
import org.springframework.osgi.context.event.OsgiBundleApplicationContextEventMulticaster;
|
||||
import org.springframework.osgi.context.event.OsgiBundleApplicationContextListener;
|
||||
import org.springframework.osgi.extender.OsgiApplicationContextCreator;
|
||||
import org.springframework.osgi.extender.internal.activator.ContextLoaderListener;
|
||||
import org.springframework.osgi.extender.internal.dependencies.shutdown.BundleDependencyComparator;
|
||||
import org.springframework.osgi.extender.internal.dependencies.shutdown.ComparatorServiceDependencySorter;
|
||||
import org.springframework.osgi.extender.internal.dependencies.shutdown.ServiceDependencySorter;
|
||||
import org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor;
|
||||
import org.springframework.osgi.extender.internal.support.NamespaceManager;
|
||||
import org.springframework.osgi.extender.internal.support.OsgiBeanFactoryPostProcessorAdapter;
|
||||
import org.springframework.osgi.extender.internal.util.concurrent.Counter;
|
||||
import org.springframework.osgi.extender.internal.util.concurrent.RunnableTimedExecution;
|
||||
import org.springframework.osgi.extender.support.ApplicationContextConfiguration;
|
||||
import org.springframework.osgi.extender.support.internal.ConfigUtils;
|
||||
import org.springframework.osgi.service.importer.support.Cardinality;
|
||||
import org.springframework.osgi.service.importer.support.CollectionType;
|
||||
import org.springframework.osgi.service.importer.support.OsgiServiceCollectionProxyFactoryBean;
|
||||
import org.springframework.osgi.util.OsgiBundleUtils;
|
||||
import org.springframework.osgi.util.OsgiStringUtils;
|
||||
import org.osgi.framework.Constants;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -65,749 +38,133 @@ import org.springframework.osgi.util.OsgiStringUtils;
|
|||
*/
|
||||
public class Activator implements BundleActivator {
|
||||
|
||||
/**
|
||||
* Common base class for {@link ContextLoaderListener} listeners.
|
||||
*
|
||||
* @author Costin Leau
|
||||
*/
|
||||
private abstract class BaseListener implements SynchronousBundleListener {
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.raytheon.uf.viz.spring.dm";
|
||||
|
||||
/**
|
||||
* A bundle has been started, stopped, resolved, or unresolved. This
|
||||
* method is a synchronous callback, do not do any long-running work in
|
||||
* this thread.
|
||||
*
|
||||
* @see org.osgi.framework.SynchronousBundleListener#bundleChanged
|
||||
*/
|
||||
public void bundleChanged(BundleEvent event) {
|
||||
private static final String SPRING_PATH = "res" + IPath.SEPARATOR
|
||||
+ "spring";
|
||||
|
||||
boolean trace = log.isTraceEnabled();
|
||||
private static final String SPRING_FILE_EXT = "*.xml";
|
||||
|
||||
// check if the listener is still alive
|
||||
synchronized (monitor) {
|
||||
if (isClosed) {
|
||||
if (trace)
|
||||
log.trace("Listener is closed; events are being ignored");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (trace) {
|
||||
log.debug("Processing bundle event ["
|
||||
+ OsgiStringUtils.nullSafeToString(event)
|
||||
+ "] for bundle ["
|
||||
+ OsgiStringUtils.nullSafeSymbolicName(event
|
||||
.getBundle()) + "]");
|
||||
}
|
||||
try {
|
||||
handleEvent(event);
|
||||
} catch (Exception ex) {
|
||||
/* log exceptions before swallowing */
|
||||
log.warn("Got exception while handling event " + event, ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void handleEvent(BundleEvent event);
|
||||
}
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* Bundle listener used for detecting namespace handler/resolvers. Exists as
|
||||
* a separate listener so that it can be registered early to avoid race
|
||||
* conditions with bundles in INSTALLING state but still to avoid premature
|
||||
* context creation before the Spring {@link ContextLoaderListener} is not
|
||||
* fully initialized.
|
||||
*
|
||||
* @author Costin Leau
|
||||
* The constructor
|
||||
*/
|
||||
private class NamespaceBundleLister extends BaseListener {
|
||||
|
||||
protected void handleEvent(BundleEvent event) {
|
||||
|
||||
Bundle bundle = event.getBundle();
|
||||
|
||||
switch (event.getType()) {
|
||||
case BundleEvent.STARTED: {
|
||||
maybeAddNamespaceHandlerFor(bundle);
|
||||
break;
|
||||
}
|
||||
case BundleEvent.STOPPED: {
|
||||
maybeRemoveNameSpaceHandlerFor(bundle);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bundle listener used for context creation/destruction.
|
||||
*/
|
||||
private class ContextBundleListener extends BaseListener {
|
||||
|
||||
protected void handleEvent(BundleEvent event) {
|
||||
|
||||
Bundle bundle = event.getBundle();
|
||||
|
||||
// ignore current bundle for context creation
|
||||
if (bundle.getBundleId() == bundleId) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.getType()) {
|
||||
case BundleEvent.STARTED: {
|
||||
maybeCreateApplicationContextFor(bundle);
|
||||
break;
|
||||
}
|
||||
case BundleEvent.STOPPING: {
|
||||
if (OsgiBundleUtils.isSystemBundle(bundle)) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("System bundle stopping");
|
||||
}
|
||||
// System bundle is shutting down; Special handling for
|
||||
// framework shutdown
|
||||
shutdown();
|
||||
} else {
|
||||
maybeCloseApplicationContextFor(bundle);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final Log log = LogFactory
|
||||
.getLog(ContextLoaderListener.class);
|
||||
|
||||
// "Spring Application Context Creation Timer"
|
||||
private Timer timer = new Timer(true);
|
||||
|
||||
/** extender bundle id */
|
||||
private long bundleId;
|
||||
|
||||
/** extender configuration */
|
||||
private ExtenderConfiguration extenderConfiguration;
|
||||
|
||||
/**
|
||||
* The contexts we are currently managing. Keys are bundle ids, values are
|
||||
* ServiceDependentOsgiApplicationContexts for the application context
|
||||
*/
|
||||
private final Map managedContexts;
|
||||
|
||||
/** Task executor used for bootstraping the Spring contexts in async mode */
|
||||
private TaskExecutor taskExecutor;
|
||||
|
||||
/** ApplicationContext Creator */
|
||||
private OsgiApplicationContextCreator contextCreator;
|
||||
|
||||
/** BFPP list */
|
||||
private List postProcessors;
|
||||
|
||||
/**
|
||||
* Task executor which uses the same thread for running tasks. Used when
|
||||
* doing a synchronous wait-for-dependencies.
|
||||
*/
|
||||
private TaskExecutor sameThreadTaskExecutor = new SyncTaskExecutor();
|
||||
|
||||
/** listener counter - used to properly synchronize shutdown */
|
||||
private Counter contextsStarted = new Counter("contextsStarted");
|
||||
|
||||
/** Spring namespace/resolver manager */
|
||||
private NamespaceManager nsManager;
|
||||
|
||||
/** The bundle's context */
|
||||
private BundleContext bundleContext;
|
||||
|
||||
/** Bundle listener interested in context creation */
|
||||
private SynchronousBundleListener contextListener;
|
||||
|
||||
/** Bundle listener interested in namespace resolvers/parsers discovery */
|
||||
private SynchronousBundleListener nsListener;
|
||||
|
||||
/** Service-based dependency sorter for shutdown */
|
||||
private ServiceDependencySorter shutdownDependencySorter = new ComparatorServiceDependencySorter();
|
||||
|
||||
/**
|
||||
* Monitor used for dealing with the bundle activator and synchronous bundle
|
||||
* threads
|
||||
*/
|
||||
private transient final Object monitor = new Object();
|
||||
|
||||
/**
|
||||
* flag indicating whether the context is down or not - useful during
|
||||
* shutdown
|
||||
*/
|
||||
private boolean isClosed = false;
|
||||
|
||||
/** This extender version */
|
||||
private Version extenderVersion;
|
||||
|
||||
private OsgiBundleApplicationContextEventMulticaster multicaster;
|
||||
|
||||
/** listeners interested in monitoring managed OSGi appCtxs */
|
||||
private List applicationListeners;
|
||||
|
||||
/** dynamicList clean up hook */
|
||||
private DisposableBean applicationListenersCleaner;
|
||||
|
||||
/** shutdown task executor */
|
||||
private TaskExecutor shutdownTaskExecutor;
|
||||
|
||||
/** Required by the BundleActivator contract */
|
||||
public Activator() {
|
||||
this.managedContexts = CollectionFactory.createConcurrentMap(16);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p/>
|
||||
* Called by OSGi when this bundle is started. Finds all previously resolved
|
||||
* bundles and adds namespace handlers for them if necessary.
|
||||
* </p>
|
||||
* <p/>
|
||||
* Creates application contexts for bundles started before the extender was
|
||||
* started.
|
||||
* </p>
|
||||
* <p/>
|
||||
* Registers a namespace/entity resolving service for use by web app
|
||||
* contexts.
|
||||
* </p>
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.osgi.framework.BundleActivator#start
|
||||
* @see
|
||||
* org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
plugin = this;
|
||||
|
||||
this.bundleContext = context;
|
||||
this.bundleId = context.getBundle().getBundleId();
|
||||
Map<String, OSGIXmlApplicationContext> contextMap = new HashMap<String, OSGIXmlApplicationContext>();
|
||||
Set<String> processing = new HashSet<String>();
|
||||
Bundle[] bundles = context.getBundles();
|
||||
Map<String, Bundle> bundleMap = new HashMap<String, Bundle>();
|
||||
for (Bundle b : bundles) {
|
||||
bundleMap.put(b.getSymbolicName(), b);
|
||||
}
|
||||
for (Bundle b : bundles) {
|
||||
createContext(bundleMap, contextMap, b, processing);
|
||||
}
|
||||
}
|
||||
|
||||
this.extenderVersion = OsgiBundleUtils.getBundleVersion(context
|
||||
.getBundle());
|
||||
log.info("Starting [" + bundleContext.getBundle().getSymbolicName()
|
||||
+ "] bundle v.[" + extenderVersion + "]");
|
||||
|
||||
// Step 1 : discover existing namespaces (in case there are fragments
|
||||
// with custom XML definitions)
|
||||
nsManager = new NamespaceManager(context);
|
||||
|
||||
// register listener first to make sure any bundles in INSTALLED state
|
||||
// are not lost
|
||||
nsListener = new NamespaceBundleLister();
|
||||
context.addBundleListener(nsListener);
|
||||
|
||||
Bundle[] previousBundles = context.getBundles();
|
||||
|
||||
for (int i = 0; i < previousBundles.length; i++) {
|
||||
Bundle bundle = previousBundles[i];
|
||||
if (OsgiBundleUtils.isBundleResolved(bundle)) {
|
||||
maybeAddNamespaceHandlerFor(bundle);
|
||||
private OSGIXmlApplicationContext createContext(
|
||||
Map<String, Bundle> bundles,
|
||||
Map<String, OSGIXmlApplicationContext> contextMap, Bundle bundle,
|
||||
Set<String> processing) {
|
||||
String bundleName = bundle.getSymbolicName();
|
||||
OSGIXmlApplicationContext appCtx = contextMap.get(bundleName);
|
||||
if (contextMap.containsKey(bundleName) == false
|
||||
&& bundleName.contains(".edex.") == false) {
|
||||
if (processing.contains(bundleName)) {
|
||||
throw new RuntimeException(
|
||||
"Found recursive spring dependency while processing plugins: "
|
||||
+ bundleName);
|
||||
}
|
||||
}
|
||||
processing.add(bundleName);
|
||||
|
||||
// discovery finished, publish the resolvers/parsers in the OSGi space
|
||||
nsManager.afterPropertiesSet();
|
||||
|
||||
// Step 2: initialize the extender configuration
|
||||
try {
|
||||
extenderConfiguration = new ExtenderConfiguration(context);
|
||||
} catch (Exception ex) {
|
||||
log.error("Unable to process extender configuration", ex);
|
||||
throw ex;
|
||||
}
|
||||
|
||||
// initialize the configuration once namespace handlers have been
|
||||
// detected
|
||||
this.taskExecutor = extenderConfiguration.getTaskExecutor();
|
||||
this.shutdownTaskExecutor = extenderConfiguration
|
||||
.getShutdownTaskExecutor();
|
||||
|
||||
this.contextCreator = extenderConfiguration.getContextCreator();
|
||||
this.postProcessors = extenderConfiguration.getPostProcessors();
|
||||
|
||||
// init the OSGi event dispatch/listening system
|
||||
initListenerService();
|
||||
|
||||
// Step 3: discover the bundles that are started
|
||||
// and require context creation
|
||||
|
||||
// register the context creation listener
|
||||
contextListener = new ContextBundleListener();
|
||||
// listen to any changes in bundles
|
||||
context.addBundleListener(contextListener);
|
||||
// get the bundles again to get an updated view
|
||||
previousBundles = context.getBundles();
|
||||
|
||||
// Instantiate all previously resolved bundles which are Spring
|
||||
// powered
|
||||
for (int i = 0; i < previousBundles.length; i++) {
|
||||
if (OsgiBundleUtils.isBundleActive(previousBundles[i])) {
|
||||
try {
|
||||
maybeCreateApplicationContextFor(previousBundles[i]);
|
||||
} catch (Throwable e) {
|
||||
log.warn(
|
||||
"Cannot start bundle "
|
||||
+ OsgiStringUtils
|
||||
.nullSafeSymbolicName(previousBundles[i])
|
||||
+ " due to", e);
|
||||
// No context created yet and not edex project, check for files
|
||||
Enumeration<?> entries = bundle.findEntries(SPRING_PATH,
|
||||
SPRING_FILE_EXT, true);
|
||||
if (entries != null) {
|
||||
List<String> files = new ArrayList<String>();
|
||||
while (entries.hasMoreElements()) {
|
||||
URL url = (URL) entries.nextElement();
|
||||
try {
|
||||
url = FileLocator.toFileURL(url);
|
||||
files.add(url.toString());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(
|
||||
"Error resolving spring file: " + url, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by OSGi when this bundled is stopped. Unregister the
|
||||
* namespace/entity resolving service and clear all state. No further
|
||||
* management of application contexts created by this extender prior to
|
||||
* stopping the bundle occurs after this point (even if the extender bundle
|
||||
* is subsequently restarted).
|
||||
*
|
||||
* @see org.osgi.framework.BundleActivator#stop
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown the extender and all bundled managed by it. Shutdown of contexts
|
||||
* is in the topological order of the dependency graph formed by the service
|
||||
* references.
|
||||
*/
|
||||
protected void shutdown() {
|
||||
synchronized (monitor) {
|
||||
// if already closed, bail out
|
||||
if (isClosed)
|
||||
return;
|
||||
else
|
||||
isClosed = true;
|
||||
}
|
||||
log.info("Stopping [" + bundleContext.getBundle().getSymbolicName()
|
||||
+ "] bundle v.[" + extenderVersion + "]");
|
||||
|
||||
// first stop the watchdog
|
||||
stopTimer();
|
||||
|
||||
// remove the bundle listeners (we are closing down)
|
||||
if (contextListener != null) {
|
||||
bundleContext.removeBundleListener(contextListener);
|
||||
contextListener = null;
|
||||
}
|
||||
|
||||
if (nsListener != null) {
|
||||
bundleContext.removeBundleListener(nsListener);
|
||||
nsListener = null;
|
||||
}
|
||||
|
||||
// destroy bundles
|
||||
Bundle[] bundles = new Bundle[managedContexts.size()];
|
||||
|
||||
int i = 0;
|
||||
for (Iterator it = managedContexts.values().iterator(); it.hasNext();) {
|
||||
ConfigurableOsgiBundleApplicationContext context = (ConfigurableOsgiBundleApplicationContext) it
|
||||
.next();
|
||||
bundles[i++] = context.getBundle();
|
||||
}
|
||||
|
||||
bundles = shutdownDependencySorter
|
||||
.computeServiceDependencyGraph(bundles);
|
||||
|
||||
boolean debug = log.isDebugEnabled();
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
if (debug) {
|
||||
buffer.append("Shutdown order is: {");
|
||||
for (i = 0; i < bundles.length; i++) {
|
||||
buffer.append("\nBundle [" + bundles[i].getSymbolicName() + "]");
|
||||
ServiceReference[] services = bundles[i].getServicesInUse();
|
||||
HashSet usedBundles = new HashSet();
|
||||
if (services != null) {
|
||||
for (int j = 0; j < services.length; j++) {
|
||||
if (BundleDependencyComparator
|
||||
.isSpringManagedService(services[j])) {
|
||||
Bundle used = services[j].getBundle();
|
||||
if (!used.equals(bundleContext.getBundle())
|
||||
&& !usedBundles.contains(used)) {
|
||||
usedBundles.add(used);
|
||||
buffer.append("\n Using ["
|
||||
+ used.getSymbolicName() + "]");
|
||||
if (files.size() > 0) {
|
||||
// Files found, check for dependencies
|
||||
String requiredBundlesHeader = (String) bundle.getHeaders()
|
||||
.get(Constants.REQUIRE_BUNDLE);
|
||||
// Split comma separated string from MANIFEST
|
||||
String[] requiredBundles = requiredBundlesHeader
|
||||
.split("[,]");
|
||||
List<OSGIXmlApplicationContext> parentContexts = new ArrayList<OSGIXmlApplicationContext>();
|
||||
for (String requiredBndl : requiredBundles) {
|
||||
// Extract bundle name which is first item in
|
||||
// semicolon
|
||||
// split list
|
||||
String[] bndlParts = requiredBndl.split("[;]");
|
||||
Bundle reqBndl = bundles.get(bndlParts[0]);
|
||||
if (reqBndl != null) {
|
||||
// Found bundle, process context for bundle
|
||||
OSGIXmlApplicationContext parent = createContext(
|
||||
bundles, contextMap, reqBndl, processing);
|
||||
if (parent != null) {
|
||||
// Context found, add to list
|
||||
parentContexts.add(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parentContexts.size() > 0) {
|
||||
// Context with parent context
|
||||
appCtx = new OSGIXmlApplicationContext(
|
||||
new OSGIGroupApplicationContext(parentContexts),
|
||||
files.toArray(new String[0]), bundle);
|
||||
} else {
|
||||
// No parent context required
|
||||
appCtx = new OSGIXmlApplicationContext(
|
||||
files.toArray(new String[0]), bundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
buffer.append("\n}");
|
||||
log.debug(buffer);
|
||||
contextMap.put(bundleName, appCtx);
|
||||
}
|
||||
processing.remove(bundleName);
|
||||
return appCtx;
|
||||
}
|
||||
|
||||
final List taskList = new ArrayList(managedContexts.size());
|
||||
final List closedContexts = Collections
|
||||
.synchronizedList(new ArrayList());
|
||||
final Object[] contextClosingDown = new Object[1];
|
||||
|
||||
for (i = 0; i < bundles.length; i++) {
|
||||
Long id = new Long(bundles[i].getBundleId());
|
||||
final ConfigurableOsgiBundleApplicationContext context = (ConfigurableOsgiBundleApplicationContext) managedContexts
|
||||
.get(id);
|
||||
if (context != null) {
|
||||
closedContexts.add(context);
|
||||
// add a new runnable
|
||||
taskList.add(new Runnable() {
|
||||
|
||||
private final String toString = "Closing runnable for context "
|
||||
+ context.getDisplayName();
|
||||
|
||||
public void run() {
|
||||
contextClosingDown[0] = context;
|
||||
// eliminate context
|
||||
closedContexts.remove(context);
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("Closing appCtx "
|
||||
+ context.getDisplayName());
|
||||
context.close();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return toString;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// tasks
|
||||
final Runnable[] tasks = (Runnable[]) taskList
|
||||
.toArray(new Runnable[taskList.size()]);
|
||||
|
||||
// start the ripper >:)
|
||||
for (int j = 0; j < tasks.length; j++) {
|
||||
if (RunnableTimedExecution.execute(tasks[j],
|
||||
extenderConfiguration.getShutdownWaitTime(),
|
||||
shutdownTaskExecutor)) {
|
||||
if (debug) {
|
||||
log.debug(contextClosingDown[0]
|
||||
+ " context did not close successfully; forcing shutdown...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.managedContexts.clear();
|
||||
// clear the namespace registry
|
||||
nsManager.destroy();
|
||||
|
||||
// release listeners
|
||||
if (applicationListeners != null) {
|
||||
applicationListeners = null;
|
||||
try {
|
||||
applicationListenersCleaner.destroy();
|
||||
} catch (Exception ex) {
|
||||
log.warn(
|
||||
"exception thrown while releasing OSGi event listeners",
|
||||
ex);
|
||||
}
|
||||
}
|
||||
|
||||
// release multicaster
|
||||
if (multicaster != null) {
|
||||
multicaster.removeAllListeners();
|
||||
multicaster = null;
|
||||
}
|
||||
|
||||
// before bailing out; wait for the threads that might be left by
|
||||
// the task executor
|
||||
stopTaskExecutor();
|
||||
|
||||
extenderConfiguration.destroy();
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel any tasks scheduled for the timer.
|
||||
*/
|
||||
private void stopTimer() {
|
||||
if (timer != null) {
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("Canceling timer tasks");
|
||||
timer.cancel();
|
||||
}
|
||||
timer = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do some additional waiting so the service dependency listeners detect the
|
||||
* shutdown.
|
||||
*/
|
||||
private void stopTaskExecutor() {
|
||||
boolean debug = log.isDebugEnabled();
|
||||
|
||||
if (debug)
|
||||
log.debug("Waiting for " + contextsStarted
|
||||
+ " service dependency listener(s) to stop...");
|
||||
|
||||
contextsStarted
|
||||
.waitForZero(extenderConfiguration.getShutdownWaitTime());
|
||||
|
||||
if (!contextsStarted.isZero()) {
|
||||
if (debug)
|
||||
log.debug(contextsStarted.getValue()
|
||||
+ " service dependency listener(s) did not responded in time; forcing them to shutdown...");
|
||||
extenderConfiguration.setForceThreadShutdown(true);
|
||||
}
|
||||
|
||||
else
|
||||
log.debug("All listeners closed");
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method that does extender range versioning and approapriate
|
||||
* logging.
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @param bundle
|
||||
* @return the shared instance
|
||||
*/
|
||||
private boolean handlerBundleMatchesExtenderVersion(Bundle bundle) {
|
||||
if (!ConfigUtils.matchExtenderVersionRange(bundle, extenderVersion)) {
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("Bundle ["
|
||||
+ OsgiStringUtils.nullSafeNameAndSymName(bundle)
|
||||
+ "] expects an extender w/ version["
|
||||
+ OsgiBundleUtils.getHeaderAsVersion(bundle,
|
||||
ConfigUtils.EXTENDER_VERSION)
|
||||
+ "] which does not match current extender w/ version["
|
||||
+ extenderVersion
|
||||
+ "]; skipping bundle from handler detection");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void maybeAddNamespaceHandlerFor(Bundle bundle) {
|
||||
if (handlerBundleMatchesExtenderVersion(bundle))
|
||||
nsManager.maybeAddNamespaceHandlerFor(bundle);
|
||||
}
|
||||
|
||||
private void maybeRemoveNameSpaceHandlerFor(Bundle bundle) {
|
||||
if (handlerBundleMatchesExtenderVersion(bundle))
|
||||
nsManager.maybeRemoveNameSpaceHandlerFor(bundle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Context creation is a potentially long-running activity (certainly more
|
||||
* than we want to do on the synchronous event callback).
|
||||
*
|
||||
* <p/>
|
||||
* Based on our configuration, the context can be started on the same thread
|
||||
* or on a different one.
|
||||
*
|
||||
* <p/>
|
||||
* Kick off a background activity to create an application context for the
|
||||
* given bundle if needed.
|
||||
*
|
||||
* <b>Note:</b> Make sure to do the fastest filtering first to avoid
|
||||
* slowdowns on platforms with a big number of plugins and wiring (i.e.
|
||||
* Eclipse platform).
|
||||
*
|
||||
* @param bundle
|
||||
*/
|
||||
protected void maybeCreateApplicationContextFor(Bundle bundle) {
|
||||
|
||||
boolean debug = log.isDebugEnabled();
|
||||
String bundleString = "["
|
||||
+ OsgiStringUtils.nullSafeNameAndSymName(bundle) + "]";
|
||||
|
||||
final Long bundleId = new Long(bundle.getBundleId());
|
||||
|
||||
if (managedContexts.containsKey(bundleId)) {
|
||||
if (debug) {
|
||||
log.debug("Bundle " + bundleString
|
||||
+ " is already managed; ignoring...");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ConfigUtils.matchExtenderVersionRange(bundle, extenderVersion)) {
|
||||
if (debug)
|
||||
log.debug("Bundle "
|
||||
+ bundleString
|
||||
+ " expects an extender w/ version["
|
||||
+ OsgiBundleUtils.getHeaderAsVersion(bundle,
|
||||
ConfigUtils.EXTENDER_VERSION)
|
||||
+ "] which does not match current extender w/ version["
|
||||
+ extenderVersion
|
||||
+ "]; skipping bundle from context creation");
|
||||
return;
|
||||
}
|
||||
|
||||
BundleContext localBundleContext = OsgiBundleUtils
|
||||
.getBundleContext(bundle);
|
||||
|
||||
if (debug)
|
||||
log.debug("Scanning bundle " + bundleString
|
||||
+ " for configurations...");
|
||||
|
||||
// initialize context
|
||||
final DelegatedExecutionOsgiBundleApplicationContext localApplicationContext;
|
||||
|
||||
if (debug)
|
||||
log.debug("Creating an application context for bundle "
|
||||
+ bundleString);
|
||||
|
||||
try {
|
||||
localApplicationContext = contextCreator
|
||||
.createApplicationContext(localBundleContext);
|
||||
} catch (Exception ex) {
|
||||
log.error("Cannot create application context for bundle "
|
||||
+ bundleString, ex);
|
||||
return;
|
||||
}
|
||||
|
||||
if (localApplicationContext == null) {
|
||||
log.debug("No application context created for bundle "
|
||||
+ bundleString);
|
||||
return;
|
||||
}
|
||||
|
||||
// create a dedicated hook for this application context
|
||||
BeanFactoryPostProcessor processingHook = new OsgiBeanFactoryPostProcessorAdapter(
|
||||
localBundleContext, postProcessors);
|
||||
|
||||
// add in the post processors
|
||||
localApplicationContext.addBeanFactoryPostProcessor(processingHook);
|
||||
|
||||
// add the context to the tracker
|
||||
managedContexts.put(bundleId, localApplicationContext);
|
||||
|
||||
localApplicationContext.setDelegatedEventMulticaster(multicaster);
|
||||
|
||||
// create refresh runnable
|
||||
Runnable contextRefresh = new Runnable() {
|
||||
|
||||
public void run() {
|
||||
localApplicationContext.refresh();
|
||||
}
|
||||
};
|
||||
|
||||
// executor used for creating the appCtx
|
||||
// chosen based on the sync/async configuration
|
||||
TaskExecutor executor = null;
|
||||
|
||||
ApplicationContextConfiguration config = new ApplicationContextConfiguration(
|
||||
bundle);
|
||||
|
||||
String creationType;
|
||||
|
||||
// synch/asynch context creation
|
||||
if (config.isCreateAsynchronously()) {
|
||||
// for the async stuff use the executor
|
||||
executor = taskExecutor;
|
||||
creationType = "Asynchronous";
|
||||
} else {
|
||||
// for the sync stuff, use this thread
|
||||
executor = sameThreadTaskExecutor;
|
||||
creationType = "Synchronous";
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
log.debug(creationType + " context creation for bundle "
|
||||
+ bundleString);
|
||||
}
|
||||
|
||||
// wait/no wait for dependencies behaviour
|
||||
if (config.isWaitForDependencies()) {
|
||||
DependencyWaiterApplicationContextExecutor appCtxExecutor = new DependencyWaiterApplicationContextExecutor(
|
||||
localApplicationContext, !config.isCreateAsynchronously(),
|
||||
extenderConfiguration.getDependencyFactories());
|
||||
|
||||
long timeout;
|
||||
// check whether a timeout has been defined
|
||||
|
||||
if (ConfigUtils.isDirectiveDefined(bundle.getHeaders(),
|
||||
ConfigUtils.DIRECTIVE_TIMEOUT)) {
|
||||
timeout = config.getTimeout();
|
||||
if (debug)
|
||||
log.debug("Setting bundle-defined, wait-for-dependencies timeout value="
|
||||
+ timeout + " ms, for bundle " + bundleString);
|
||||
|
||||
} else {
|
||||
timeout = extenderConfiguration.getDependencyWaitTime();
|
||||
if (debug)
|
||||
log.debug("Setting globally defined wait-for-dependencies timeout value="
|
||||
+ timeout + " ms, for bundle " + bundleString);
|
||||
}
|
||||
|
||||
appCtxExecutor.setTimeout(config.getTimeout());
|
||||
|
||||
appCtxExecutor.setWatchdog(timer);
|
||||
appCtxExecutor.setTaskExecutor(executor);
|
||||
appCtxExecutor.setMonitoringCounter(contextsStarted);
|
||||
// set events publisher
|
||||
appCtxExecutor.setDelegatedMulticaster(this.multicaster);
|
||||
|
||||
contextsStarted.increment();
|
||||
} else {
|
||||
// do nothing; by default contexts do not wait for services.
|
||||
}
|
||||
|
||||
executor.execute(contextRefresh);
|
||||
}
|
||||
|
||||
/**
|
||||
* Closing an application context is a potentially long-running activity,
|
||||
* however, we *have* to do it synchronously during the event process as the
|
||||
* BundleContext object is not valid once we return from this method.
|
||||
*
|
||||
* @param bundle
|
||||
*/
|
||||
protected void maybeCloseApplicationContextFor(Bundle bundle) {
|
||||
final ConfigurableOsgiBundleApplicationContext context = (ConfigurableOsgiBundleApplicationContext) managedContexts
|
||||
.remove(new Long(bundle.getBundleId()));
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
RunnableTimedExecution.execute(new Runnable() {
|
||||
|
||||
private final String toString = "Closing runnable for context "
|
||||
+ context.getDisplayName();
|
||||
|
||||
public void run() {
|
||||
if (context.isActive()) {
|
||||
context.close();
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return toString;
|
||||
}
|
||||
|
||||
}, extenderConfiguration.getShutdownWaitTime(), shutdownTaskExecutor);
|
||||
}
|
||||
|
||||
private void initListenerService() {
|
||||
multicaster = extenderConfiguration.getEventMulticaster();
|
||||
|
||||
createListenersList();
|
||||
// register the listener that does the dispatching
|
||||
multicaster.addApplicationListener(new ListListenerAdapter(
|
||||
applicationListeners));
|
||||
multicaster.addApplicationListener(extenderConfiguration
|
||||
.getContextEventListener());
|
||||
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("Initialization of OSGi listeners service completed...");
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dynamic OSGi list of OSGi services interested in receiving
|
||||
* events for OSGi application contexts.
|
||||
*/
|
||||
private void createListenersList() {
|
||||
OsgiServiceCollectionProxyFactoryBean fb = new OsgiServiceCollectionProxyFactoryBean();
|
||||
fb.setBundleContext(bundleContext);
|
||||
fb.setCardinality(Cardinality.C_0__N);
|
||||
fb.setCollectionType(CollectionType.LIST);
|
||||
fb.setInterfaces(new Class[] { OsgiBundleApplicationContextListener.class });
|
||||
fb.setBeanClassLoader(extenderConfiguration.getClassLoader());
|
||||
fb.afterPropertiesSet();
|
||||
|
||||
applicationListenersCleaner = fb;
|
||||
applicationListeners = (List) fb.getObject();
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,88 +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 org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext;
|
||||
import org.springframework.osgi.extender.support.ApplicationContextConfiguration;
|
||||
import org.springframework.osgi.extender.support.DefaultOsgiApplicationContextCreator;
|
||||
import org.springframework.osgi.extender.support.scanning.ConfigurationScanner;
|
||||
import org.springframework.osgi.extender.support.scanning.DefaultConfigurationScanner;
|
||||
import org.springframework.osgi.util.OsgiStringUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Custom DefaultOsgiApplicationContextCreator used to turn off xml validation
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 12, 2010 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* Custom version of spring osgi ExtenderConfiguration to turn off xml validation
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 12, 2010 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @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 <code>ExtenderConfiguration</code> 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.
|
||||
*
|
||||
* <p/>
|
||||
* 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;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Oct 12, 2010 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
class ListListenerAdapter implements OsgiBundleApplicationContextListener {
|
||||
|
||||
private final List listeners;
|
||||
|
||||
/**
|
||||
* Constructs a new <code>ListListenerAdapter</code> 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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 1, 2012 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class OSGIGroupApplicationContext extends GenericApplicationContext {
|
||||
|
||||
public OSGIGroupApplicationContext(
|
||||
List<OSGIXmlApplicationContext> contextGroup) {
|
||||
refresh(); // refresh first to avoid recreating bean definitions
|
||||
DefaultListableBeanFactory factory = getDefaultListableBeanFactory();
|
||||
// Register all bean definitions from other contexts into our factory
|
||||
for (OSGIXmlApplicationContext ctx : contextGroup) {
|
||||
ConfigurableListableBeanFactory ctxFactory = ctx.getBeanFactory();
|
||||
for (String beanName : ctxFactory.getBeanDefinitionNames()) {
|
||||
factory.registerBeanDefinition(beanName,
|
||||
ctxFactory.getBeanDefinition(beanName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -19,11 +19,13 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.spring.dm;
|
||||
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.AbstractXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* Custom OsgiBundleXmlApplicationContext used to turn off xml validation
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -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
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 6, 2012 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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)
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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<GridMapKey, Set<UpdateValue>> updateMap = new HashMap<GridMapKey, Set<UpdateValue>>();
|
||||
|
||||
public GridUpdater(GridInventory inventory) {
|
||||
// TODO remove following line once Util removes static block
|
||||
Util.getCurrentMemory();
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
</features>
|
||||
|
||||
<configurations>
|
||||
<plugin id="com.raytheon.uf.viz.spring.dm" autoStart="true" startLevel="5" />
|
||||
<plugin id="com.raytheon.uf.viz.spring.dm" autoStart="true" startLevel="0" />
|
||||
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
|
||||
</configurations>
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry exported="true" kind="lib" path="org.springframework.osgi.core-1.2.0.jar" sourcepath="org.springframework.osgi.core-sources-1.2.0.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="org.springframework.osgi.extender-1.2.0.jar" sourcepath="org.springframework.osgi.extender-sources-1.2.0.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="org.springframework.osgi.io-1.2.0.jar" sourcepath="org.springframework.osgi.io-sources-1.2.0.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -1,58 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Spring OSGI
|
||||
Bundle-SymbolicName: org.springframework.dm
|
||||
Bundle-Version: 1.2.1
|
||||
Bundle-ClassPath: org.springframework.osgi.core-1.2.0.jar,
|
||||
org.springframework.osgi.extender-1.2.0.jar,
|
||||
org.springframework.osgi.io-1.2.0.jar
|
||||
Export-Package: org.springframework.osgi,
|
||||
org.springframework.osgi.bundle,
|
||||
org.springframework.osgi.compendium.cm,
|
||||
org.springframework.osgi.compendium.config,
|
||||
org.springframework.osgi.compendium.internal.cm,
|
||||
org.springframework.osgi.config,
|
||||
org.springframework.osgi.config.internal.adapter,
|
||||
org.springframework.osgi.config.internal.util,
|
||||
org.springframework.osgi.context,
|
||||
org.springframework.osgi.context.event,
|
||||
org.springframework.osgi.context.internal.classloader,
|
||||
org.springframework.osgi.context.support,
|
||||
org.springframework.osgi.context.support.internal,
|
||||
org.springframework.osgi.extender,
|
||||
org.springframework.osgi.extender.event,
|
||||
org.springframework.osgi.extender.internal.activator,
|
||||
org.springframework.osgi.extender.internal.dependencies.shutdown,
|
||||
org.springframework.osgi.extender.internal.dependencies.startup,
|
||||
org.springframework.osgi.extender.internal.support,
|
||||
org.springframework.osgi.extender.internal.util,
|
||||
org.springframework.osgi.extender.internal.util.concurrent,
|
||||
org.springframework.osgi.extender.support,
|
||||
org.springframework.osgi.extender.support.internal,
|
||||
org.springframework.osgi.extender.support.scanning,
|
||||
org.springframework.osgi.io,
|
||||
org.springframework.osgi.io.internal,
|
||||
org.springframework.osgi.io.internal.resolver,
|
||||
org.springframework.osgi.service,
|
||||
org.springframework.osgi.service.dependency.internal,
|
||||
org.springframework.osgi.service.exporter,
|
||||
org.springframework.osgi.service.exporter.support,
|
||||
org.springframework.osgi.service.exporter.support.internal.controller,
|
||||
org.springframework.osgi.service.exporter.support.internal.support,
|
||||
org.springframework.osgi.service.importer,
|
||||
org.springframework.osgi.service.importer.event,
|
||||
org.springframework.osgi.service.importer.support,
|
||||
org.springframework.osgi.service.importer.support.internal.aop,
|
||||
org.springframework.osgi.service.importer.support.internal.collection,
|
||||
org.springframework.osgi.service.importer.support.internal.collection.comparator,
|
||||
org.springframework.osgi.service.importer.support.internal.controller,
|
||||
org.springframework.osgi.service.importer.support.internal.dependency,
|
||||
org.springframework.osgi.service.importer.support.internal.support,
|
||||
org.springframework.osgi.service.importer.support.internal.util,
|
||||
org.springframework.osgi.service.util.internal.aop,
|
||||
org.springframework.osgi.util,
|
||||
org.springframework.osgi.util.internal
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: org.apache.commons.logging;bundle-version="1.1.1",
|
||||
org.eclipse.osgi;bundle-version="3.6.1",
|
||||
org.springframework;bundle-version="2.5.6"
|
|
@ -1,4 +0,0 @@
|
|||
bin.includes = META-INF/,\
|
||||
org.springframework.osgi.core-1.2.0.jar,\
|
||||
org.springframework.osgi.extender-1.2.0.jar,\
|
||||
org.springframework.osgi.io-1.2.0.jar
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -174,16 +174,6 @@
|
|||
<property name="routeId" value="siteActivationRoute"/>
|
||||
</bean>
|
||||
|
||||
<bean class="com.raytheon.uf.common.dataplugin.convert.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.geospatial.util.JtsGeometryConverter"/></constructor-arg>
|
||||
<constructor-arg><value>com.vividsolutions.jts.geom.Geometry</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean class="com.raytheon.uf.common.dataplugin.convert.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.dataplugin.convert.UnitConverter"/></constructor-arg>
|
||||
<constructor-arg><value>javax.measure.unit.Unit</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="commonDbPluginProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
|
||||
<property name="pluginFQN" value="com.raytheon.uf.edex.database" />
|
||||
<property name="database" value="metadata" />
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.edex.common">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -24,8 +24,8 @@ import java.util.Calendar;
|
|||
import java.util.Date;
|
||||
|
||||
import com.raytheon.edex.util.Util;
|
||||
import com.raytheon.uf.common.dataplugin.convert.ConvertUtil;
|
||||
import com.raytheon.uf.common.message.response.AbstractResponseMessage;
|
||||
import com.raytheon.uf.common.util.ConvertUtil;
|
||||
|
||||
/**
|
||||
* Represents an ASCII product response from EDEX.
|
||||
|
|
|
@ -51,26 +51,17 @@ import java.util.regex.Pattern;
|
|||
import java.util.zip.DataFormatException;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import javax.measure.unit.Unit;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.apache.commons.beanutils.ConvertUtils;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.convert.ConvertUtil;
|
||||
import com.raytheon.uf.common.dataplugin.convert.UnitConverter;
|
||||
import com.raytheon.uf.common.geospatial.util.JtsGeometryConverter;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.util.CalendarConverter;
|
||||
import com.raytheon.uf.common.time.util.DataTimeConverter;
|
||||
import com.raytheon.uf.common.time.util.DateConverter;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.raytheon.uf.common.util.ConvertUtil;
|
||||
|
||||
/**
|
||||
* Contains utility methods for use in common.
|
||||
|
@ -121,17 +112,6 @@ public final class Util {
|
|||
|
||||
public static final float GRID_FILL_VALUE = -999999;
|
||||
|
||||
// TODO remove this static block
|
||||
// this registration should occur in spring and edex is set up to
|
||||
// do this but CAVE isn't yet
|
||||
static {
|
||||
ConvertUtils.register(new DataTimeConverter(), DataTime.class);
|
||||
ConvertUtils.register(new CalendarConverter(), Calendar.class);
|
||||
ConvertUtils.register(new UnitConverter(), Unit.class);
|
||||
ConvertUtils.register(new DateConverter(), Date.class);
|
||||
ConvertUtils.register(new JtsGeometryConverter(), Geometry.class);
|
||||
}
|
||||
|
||||
private Util() {
|
||||
// No Instantiation
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ Bundle-Vendor: RAYTHEON
|
|||
Require-Bundle: org.apache.commons.logging,
|
||||
com.raytheon.edex.common,
|
||||
com.raytheon.uf.edex.decodertools;bundle-version="1.0.0",
|
||||
javax.persistence
|
||||
javax.persistence,
|
||||
com.raytheon.uf.common.dataplugin.binlightning;bundle-version="1.12.1174";visibility:=reexport
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.common.dataplugin.binlightning,
|
||||
com.raytheon.uf.common.dataplugin.binlightning.dao,
|
||||
com.raytheon.uf.common.dataplugin.binlightning.impl
|
||||
Export-Package: com.raytheon.edex.plugin.binlightning.dao
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.edex.plugin.binlightning">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -7,7 +7,7 @@
|
|||
<bean id="binlightningProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
|
||||
<property name="pluginName" value="binlightning" />
|
||||
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.binlightning" />
|
||||
<property name="dao" value="com.raytheon.uf.common.dataplugin.binlightning.dao.BinLightningDao" />
|
||||
<property name="dao" value="com.raytheon.edex.plugin.binlightning.dao.BinLightningDao" />
|
||||
<property name="record" value="com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord" />
|
||||
</bean>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* further licensing information.
|
||||
**/
|
||||
|
||||
package com.raytheon.uf.common.dataplugin.binlightning.dao;
|
||||
package com.raytheon.edex.plugin.binlightning.dao;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
|
@ -14,7 +14,9 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.bufrua;bundle-version="1.0.0",
|
|||
com.raytheon.uf.edex.pointdata;bundle-version="1.11.8",
|
||||
javax.measure,
|
||||
org.geotools,
|
||||
javax.persistence
|
||||
javax.persistence,
|
||||
com.raytheon.uf.edex.menus;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Export-Package: com.raytheon.edex.plugin.bufrua.dao
|
||||
Import-Package: com.raytheon.uf.common.status
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.edex.plugin.bufrua">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -4,10 +4,10 @@
|
|||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="raobMenuUtil" class="com.raytheon.uf.common.sounding.util.RaobMenuUtil" />
|
||||
<bean id="menuCreationRegistry" class="com.raytheon.uf.common.menus.MenuCreationRegistry" factory-method="getInstance" />
|
||||
<bean id="raobMenuUtil" class="com.raytheon.edex.plugin.bufrua.util.RaobMenuUtil" />
|
||||
<bean id="raobMenus" factory-bean="menuCreationRegistry" factory-method="register">
|
||||
<constructor-arg value="raob"/>
|
||||
<constructor-arg ref="raobMenuUtil"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
|
@ -17,14 +17,13 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.sounding.util;
|
||||
package com.raytheon.edex.plugin.bufrua.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.menus.AbstractMenuUtil;
|
||||
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonBundleMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonPlaceholderMenuContribution;
|
||||
|
@ -33,6 +32,7 @@ import com.raytheon.uf.common.menus.xml.MenuTemplateFile;
|
|||
import com.raytheon.uf.common.menus.xml.VariableSubstitution;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.edex.menus.AbstractMenuUtil;
|
||||
|
||||
/**
|
||||
* Builds the menus for raobs
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.sounding.util;
|
||||
package com.raytheon.edex.plugin.bufrua.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.sounding.util;
|
||||
package com.raytheon.edex.plugin.bufrua.util;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
|
@ -1,23 +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.
|
||||
**/
|
||||
/**
|
||||
* BUFR Upperair data access classes. and other possible utility classes.
|
||||
*/
|
||||
package com.raytheon.edex.util.bufrua;
|
|
@ -14,7 +14,8 @@ Require-Bundle: com.raytheon.edex.common,
|
|||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.common.status;bundle-version="1.11.11",
|
||||
com.raytheon.uf.common.dataplugin.radar
|
||||
com.raytheon.uf.common.dataplugin.radar,
|
||||
com.raytheon.uf.edex.menus;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.edex.plugin.radar,
|
||||
com.raytheon.edex.plugin.radar.dao,
|
||||
|
@ -22,9 +23,7 @@ Export-Package: com.raytheon.edex.plugin.radar,
|
|||
com.raytheon.edex.uengine.tasks.radar
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.common.comm,
|
||||
com.raytheon.uf.common.menus,
|
||||
com.raytheon.uf.common.menus.xml,
|
||||
com.raytheon.uf.common.site.ingest,
|
||||
com.raytheon.uf.common.dataplugin.text.db,
|
||||
com.raytheon.uf.common.site.ingest,
|
||||
org.apache.commons.logging,
|
||||
org.apache.tools.bzip2
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.edex.plugin.radar">
|
||||
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -18,7 +18,6 @@
|
|||
</bean>
|
||||
|
||||
<bean id="radarMenuUtil" class="com.raytheon.edex.plugin.radar.util.RadarMenuUtil" />
|
||||
<bean id="menuCreationRegistry" class="com.raytheon.uf.common.menus.MenuCreationRegistry" factory-method="getInstance" />
|
||||
<bean id="radarMenus" factory-bean="menuCreationRegistry" factory-method="register">
|
||||
<constructor-arg value="radar"/>
|
||||
<constructor-arg ref="radarMenuUtil"/>
|
||||
|
|
|
@ -35,7 +35,6 @@ import java.util.Map;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarsInUseUtil;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.TerminalRadarUtils;
|
||||
import com.raytheon.uf.common.menus.AbstractMenuUtil;
|
||||
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonIncludeMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonIncludeMenuItem;
|
||||
|
@ -48,6 +47,7 @@ import com.raytheon.uf.common.site.ingest.INationalDatasetSubscriber;
|
|||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.edex.menus.AbstractMenuUtil;
|
||||
|
||||
/**
|
||||
* Builds menus using JAXB
|
||||
|
|
|
@ -12,7 +12,8 @@ Require-Bundle: com.raytheon.edex.common,
|
|||
javax.measure,
|
||||
org.apache.commons.lang,
|
||||
javax.persistence,
|
||||
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0"
|
||||
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.menus;bundle-version="1.0.0"
|
||||
Export-Package: com.raytheon.edex.plugin.satellite,
|
||||
com.raytheon.edex.plugin.satellite.dao,
|
||||
com.raytheon.edex.plugin.satellite.notify,
|
||||
|
@ -21,7 +22,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
|||
Import-Package: com.raytheon.edex.uengine.tasks.query,
|
||||
com.raytheon.uf.common.awipstools,
|
||||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.menus,
|
||||
com.raytheon.uf.common.menus.xml,
|
||||
com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.edex.awipstools
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.edex.plugin.satellite">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -5,7 +5,6 @@
|
|||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="satelliteMenuUtil" class="com.raytheon.edex.util.satellite.SatelliteMenuUtil"/>
|
||||
<bean id="menuCreationRegistry" class="com.raytheon.uf.common.menus.MenuCreationRegistry" factory-method="getInstance" />
|
||||
<bean id="satelliteMenus" factory-bean="menuCreationRegistry" factory-method="register">
|
||||
<constructor-arg value="satellite"/>
|
||||
<constructor-arg ref="satelliteMenuUtil"/>
|
||||
|
|
|
@ -30,13 +30,13 @@ import com.raytheon.uf.common.geospatial.ISpatialQuery;
|
|||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.geospatial.SpatialException;
|
||||
import com.raytheon.uf.common.geospatial.SpatialQueryFactory;
|
||||
import com.raytheon.uf.common.menus.AbstractMenuUtil;
|
||||
import com.raytheon.uf.common.menus.xml.CommonIncludeMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.MenuTemplateFile;
|
||||
import com.raytheon.uf.common.menus.xml.VariableSubstitution;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.edex.awipstools.GetWfoCenterHandler;
|
||||
import com.raytheon.uf.edex.menus.AbstractMenuUtil;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,5 +11,4 @@ Require-Bundle: org.apache.commons.logging,
|
|||
javax.persistence
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.common.dataplugin.binlightning,
|
||||
com.raytheon.uf.common.dataplugin.binlightning.dao,
|
||||
com.raytheon.uf.common.dataplugin.binlightning.impl
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.edex.plugin.textlightning">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -1,5 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/
|
||||
.
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.dataplugin.acarssounding">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex" />
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex" />
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -7,7 +7,6 @@ Bundle-Vendor: RAYTHEON
|
|||
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.binlightning,
|
||||
com.raytheon.uf.common.dataplugin.binlightning.dao,
|
||||
com.raytheon.uf.common.dataplugin.binlightning.impl
|
||||
Require-Bundle: com.raytheon.edex.common,
|
||||
org.geotools,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/
|
||||
.
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.dataplugin.binlightning">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -14,11 +14,11 @@ Import-Package: com.raytheon.uf.common.time,
|
|||
org.hibernate.annotations
|
||||
Export-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.annotations,
|
||||
com.raytheon.uf.common.dataplugin.convert,
|
||||
com.raytheon.uf.common.dataplugin.defaults,
|
||||
com.raytheon.uf.common.dataplugin.persist,
|
||||
com.raytheon.uf.common.dataplugin.request
|
||||
Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.serialization.comm
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174"
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.dataplugin">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -44,7 +44,6 @@ import org.hibernate.annotations.Index;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
|
||||
import com.raytheon.uf.common.dataplugin.convert.ConvertUtil;
|
||||
import com.raytheon.uf.common.dataplugin.persist.DefaultPathProvider;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IHDFFilePathProvider;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
||||
|
@ -54,6 +53,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.ConvertUtil;
|
||||
|
||||
/**
|
||||
* Abstract class from which all plugin specific data types inherit. A plugin
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.datastorage.remote</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1,16 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Thrift Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.datastorage.remote
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Require-Bundle: com.raytheon.uf.common.datastorage;bundle-version="1.11.11",
|
||||
com.raytheon.uf.common.message;bundle-version="1.11.11",
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.11.12",
|
||||
net.sf.cglib;bundle-version="2.1.3"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.uf.common.datastorage.remote.handlers,
|
||||
com.raytheon.uf.common.datastorage.remote.requests
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.datastorage.thrift">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -1,16 +0,0 @@
|
|||
<beans
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="retrieveData" class="com.raytheon.uf.common.datastorage.remote.handlers.RetrieveDataHandler"/>
|
||||
|
||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||
<constructor-arg value="com.raytheon.uf.common.datastorage.remote.requests.ThriftDataRequest"/>
|
||||
<constructor-arg ref="retrieveData"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
|
@ -1,87 +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.handlers;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.remote.requests.ThriftDataRequest;
|
||||
import com.raytheon.uf.common.datastorage.remote.requests.ThriftDataResponse;
|
||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
||||
|
||||
/**
|
||||
* Uses reflection to invoke an IDataStore method instead of creating a Handler
|
||||
* for each method
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 3, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class RetrieveDataHandler implements IRequestHandler<ThriftDataRequest> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.common.thrift.IRequestHandler#handleRequest(com.raytheon
|
||||
* .uf.common.thrift.IServerRequest)
|
||||
*/
|
||||
@Override
|
||||
public Object handleRequest(ThriftDataRequest req) throws Exception {
|
||||
File file = new File(req.getFile());
|
||||
if (file.getParentFile().exists() == false) {
|
||||
file = new File(new File(System.getProperty("edex.home")
|
||||
+ File.separator + "data" + File.separator + "hdf5"), file
|
||||
.getAbsolutePath());
|
||||
}
|
||||
IDataStore store = DataStoreFactory.getDataStore(file);
|
||||
Class<?>[] classes = new Class<?>[req.getParameterTypes().length];
|
||||
int i = 0;
|
||||
for (String clazz : req.getParameterTypes()) {
|
||||
classes[i++] = Class.forName(clazz);
|
||||
}
|
||||
Method m = store.getClass().getMethod(req.getMethod(), classes);
|
||||
Object obj = m.invoke(store, req.getParameters());
|
||||
if (obj == null) {
|
||||
throw new Exception("datastore returned null");
|
||||
} else if (obj instanceof IDataRecord) {
|
||||
return new ThriftDataResponse((IDataRecord) obj);
|
||||
} else if (obj instanceof IDataRecord[]) {
|
||||
return new ThriftDataResponse((IDataRecord[]) obj);
|
||||
} else if (obj instanceof String[]) {
|
||||
return new ThriftDataResponse((String[]) obj);
|
||||
} else {
|
||||
throw new Exception("datastore returned invalid response object: "
|
||||
+ obj.getClass().getName());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,107 +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.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||
|
||||
/**
|
||||
* Request for invoking a method on IDataStore using thrift. This class uses
|
||||
* reflection heavily
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 3, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 18, 2009 mschenke Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
.,\
|
||||
res/
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.datastorage.hdf5">
|
||||
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -0,0 +1,13 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean class="com.raytheon.uf.common.util.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.geospatial.util.JtsGeometryConverter"/></constructor-arg>
|
||||
<constructor-arg><value>com.vividsolutions.jts.geom.Geometry</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
</beans>
|
|
@ -11,14 +11,6 @@ Import-Package: com.raytheon.uf.common.dataplugin,
|
|||
com.raytheon.uf.common.dataplugin.persist,
|
||||
com.raytheon.uf.common.dataquery.requests,
|
||||
com.raytheon.uf.common.dataquery.responses,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.serialization.annotations,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.common.status,
|
||||
com.vividsolutions.jts.geom,
|
||||
javax.measure.converter,
|
||||
javax.measure.unit,
|
||||
javax.persistence,
|
||||
org.apache.commons.beanutils,
|
||||
org.apache.commons.collections.map,
|
||||
|
@ -31,4 +23,9 @@ Export-Package: com.raytheon.uf.common.gridcoverage,
|
|||
com.raytheon.uf.common.gridcoverage.request,
|
||||
com.raytheon.uf.common.gridcoverage.subgrid
|
||||
Require-Bundle: org.geotools;bundle-version="2.6.4",
|
||||
com.raytheon.uf.common.serialization
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.units;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174"
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean class="com.raytheon.uf.common.util.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.gridcoverage.convert.GridCoverageConverter"/></constructor-arg>
|
||||
<constructor-arg><value>com.raytheon.uf.common.gridcoverage.GridCoverage</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
</beans>
|
|
@ -1,5 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/
|
||||
.
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.menus">
|
||||
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -1,16 +0,0 @@
|
|||
<beans
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean factory-bean="menuCreationRegistry" class="com.raytheon.uf.common.menus.MenuCreationRegistry"/>
|
||||
<bean id="menuCreationHandler" class="com.raytheon.uf.common.menus.MenuCreationHandler"/>
|
||||
|
||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||
<constructor-arg value="com.raytheon.uf.common.menus.MenuCreationRequest"/>
|
||||
<constructor-arg ref="menuCreationHandler"/>
|
||||
</bean>
|
||||
</beans>
|
|
@ -20,7 +20,7 @@ Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.11.5",
|
|||
org.geotools;bundle-version="2.5.2",
|
||||
org.apache.commons.collections,
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin.binlightning;bundle-version="1.0.0",
|
||||
com.raytheon.edex.plugin.binlightning;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.11.17",
|
||||
org.eclipse.swt,
|
||||
com.raytheon.uf.common.dataplugin.grib;bundle-version="1.11.26",
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.monitor">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex" />
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex" />
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -38,9 +38,9 @@ import org.opengis.referencing.crs.ProjectedCRS;
|
|||
import org.opengis.referencing.datum.PixelInCell;
|
||||
import org.opengis.referencing.operation.TransformException;
|
||||
|
||||
import com.raytheon.edex.plugin.binlightning.dao.BinLightningDao;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.dao.BinLightningDao;
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgStrikeType;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.UAObs;
|
||||
import com.raytheon.uf.common.dataplugin.bufrua.UAObsAdapter;
|
||||
|
|
|
@ -15,8 +15,6 @@ Export-Package: com.raytheon.uf.common.sounding,
|
|||
com.raytheon.uf.common.sounding.adapter,
|
||||
com.raytheon.uf.common.sounding.util
|
||||
Import-Package: com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.menus,
|
||||
com.raytheon.uf.common.menus.xml,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.status,
|
||||
org.apache.commons.logging
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/spring/
|
||||
.
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.sounding">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -1,26 +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.
|
||||
##
|
||||
# to recreate the menu files for radar and scan
|
||||
|
||||
def generateMenuFiles():
|
||||
from com.raytheon.uf.common.sounding.util import RaobMenuUtil
|
||||
r = RaobMenuUtil()
|
||||
from com.raytheon.uf.common.message.response import ResponseMessageGeneric
|
||||
return ResponseMessageGeneric("Rebuilt upper air local menu files")
|
|
@ -7,12 +7,11 @@ Bundle-Vendor: RAYTHEON
|
|||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: net.sf.cglib,
|
||||
net.jcip;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174"
|
||||
Import-Package: com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.serialization.adapters,
|
||||
com.raytheon.uf.common.serialization.annotations,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
javax.persistence,
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
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.util;bundle-version="1.12.1174"
|
||||
Import-Package: javax.persistence,
|
||||
org.apache.commons.beanutils,
|
||||
org.apache.commons.lang,
|
||||
org.apache.commons.lang.builder,
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<project basedir="." default="deploy" name="com.raytheon.uf.common.time">
|
||||
<available file="../build.edex" property="build.dir.location" value="../build.edex"/>
|
||||
<available file="../../../../../build.edex" property="build.dir.location" value="../../../../../build.edex"/>
|
||||
|
||||
<import file="${build.dir.location}/basebuilds/component_deploy_base.xml" />
|
||||
|
||||
</project>
|
|
@ -5,17 +5,17 @@
|
|||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="dataTimeConverterRegistered" class="com.raytheon.uf.common.dataplugin.convert.ConvertUtil" factory-method="registerConverter">
|
||||
<bean id="dataTimeConverterRegistered" class="com.raytheon.uf.common.util.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.time.util.DataTimeConverter"/></constructor-arg>
|
||||
<constructor-arg><value>com.raytheon.uf.common.time.DataTime</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="calendarConverterRegistered" class="com.raytheon.uf.common.dataplugin.convert.ConvertUtil" factory-method="registerConverter">
|
||||
<bean id="calendarConverterRegistered" class="com.raytheon.uf.common.util.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.time.util.CalendarConverter"/></constructor-arg>
|
||||
<constructor-arg><value>java.util.Calendar</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="dateConverterRegistered" class="com.raytheon.uf.common.dataplugin.convert.ConvertUtil" factory-method="registerConverter">
|
||||
<bean id="dateConverterRegistered" class="com.raytheon.uf.common.util.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.time.util.DateConverter"/></constructor-arg>
|
||||
<constructor-arg><value>java.util.Date</value></constructor-arg>
|
||||
</bean>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.viz.datastorage.remote</name>
|
||||
<name>com.raytheon.uf.common.units</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
|
@ -1,4 +1,4 @@
|
|||
#Wed Oct 13 11:24:37 CDT 2010
|
||||
#Mon Nov 05 16:48:55 CST 2012
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
11
edexOsgi/com.raytheon.uf.common.units/META-INF/MANIFEST.MF
Normal file
11
edexOsgi/com.raytheon.uf.common.units/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,11 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Units
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.units
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: javax.measure;bundle-version="1.0.0";visibility:=reexport,
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174",
|
||||
org.apache.commons.beanutils;bundle-version="1.8.3"
|
||||
Export-Package: com.raytheon.uf.common.units
|
|
@ -0,0 +1,13 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean class="com.raytheon.uf.common.util.ConvertUtil" factory-method="registerConverter">
|
||||
<constructor-arg><bean class="com.raytheon.uf.common.units.UnitConverter"/></constructor-arg>
|
||||
<constructor-arg><value>javax.measure.unit.Unit</value></constructor-arg>
|
||||
</bean>
|
||||
|
||||
</beans>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue