Commit d17ef622 authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Updated the ECF configuration in the core. Updated launch file too.


Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent 51358f7d
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8082 -Dice.projectLocation=/home/bkj/ICEFiles -Dcom.sun.jersey.config.property.packages=org.eclipse.ice.core.iCore -Dorg.osgi.framework.bundle.parent=ext; -Declipse.log.level=INFO"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8082 -Dice.projectLocation=/home/bkj/ICEFiles -Dcom.sun.jersey.config.property.packages=org.eclipse.ice.core.iCore -Dorg.osgi.framework.bundle.parent=ext; -Declipse.log.level=INFO -DverboseRemoteServiceAdmin=true"/>
<stringAttribute key="pde.version" value="3.3"/> <stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="false"/> <booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="target_bundles" value="bcpkix@default:default,bcprov@default:default,ca.odell.glazedlists@default:default,ch.ethz.iks.r_osgi.remote@default:default,ch.qos.logback.classic@default:default,ch.qos.logback.core@default:default,ch.qos.logback.slf4j@default:false,com.google.gson@default:default,com.google.guava@default:default,com.google.inject.multibindings@default:false,com.google.inject@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.spotify.docker-client.shaded@default:default,com.sun.jersey@default:default,com.sun.syndication@default:default,gov.lbnl.visit.swt@default:default,javax.activation@default:default,javax.el@default:default,javax.inject@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.ws.rs@default:default,javax.xml@default:default,org.antlr.runtime*3.2.0.v201101311130@default:default,org.antlr.runtime*4.3.0.v201502022030@default:default,org.apache.ant@default:default,org.apache.batik.css*1.7.0.v201011041433@default:default,org.apache.batik.util*1.7.0.v201011041433@default:default,org.apache.batik.util.gui*1.7.0.v200903091627@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.io@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.logging*1.0.4.v201101211617@default:default,org.apache.commons.logging*1.1.1.v201101211721@default:default,org.apache.commons.math@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.eclipse.ant.core@default:default,org.eclipse.cdt.core.linux.x86_64@default:false,org.eclipse.cdt.core.linux@default:false,org.eclipse.cdt.core.native@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.debug.core@default:default,org.eclipse.draw2d@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.swt.gtk@default:false,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.eavp.geometry.view.model@default:default,org.eclipse.eavp.viz.datastructures@default:default,org.eclipse.eavp.viz.modeling@default:default,org.eclipse.eavp.viz.service.mesh@default:default,org.eclipse.eavp.viz.service.visit@default:default,org.eclipse.eavp.viz.service@default:default,org.eclipse.eavp.viz@default:default,org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.osgi.services.distribution@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin@default:default,org.eclipse.ecf.provider.discovery@default:default,org.eclipse.ecf.provider.filetransfer.httpclient4.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient4@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.provider.r_osgi@default:default,org.eclipse.ecf.provider.remoteservice@default:default,org.eclipse.ecf.provider@default:default,org.eclipse.ecf.remoteservice.asyncproxy*1.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.asyncproxy*2.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.rest.synd@default:default,org.eclipse.ecf.remoteservice.rest@default:default,org.eclipse.ecf.remoteservice.servlet@default:default,org.eclipse.ecf.remoteservice.soap@default:default,org.eclipse.ecf.remoteservice@default:default,org.eclipse.ecf.sharedobject@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.http.servletbridge@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.region@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.servletbridge@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.util@default:default,org.eclipse.equinox.weaving.hook@default:false,org.eclipse.fx.osgi@default:false,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help@default:default,org.eclipse.january.geometry.model@default:default,org.eclipse.january.geometry.xtext.obj@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jsch.core@default:default,org.eclipse.nebula.visualization.widgets@default:default,org.eclipse.nebula.visualization.xygraph@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services.remoteserviceadmin@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.platform@default:default,org.eclipse.remote.core@default:default,org.eclipse.remote.jsch.core@default:default,org.eclipse.remote.ui@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.swtbot.ant.junit@default:false,org.eclipse.text@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.wst.jsdt.nashorn.extension@default:false,org.eclipse.xsd@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.junit@default:default,org.objectweb.asm@default:default,org.slf4j.api@default:default,org.slf4j.impl.log4j12@default:false,org.tukaani.xz@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil*1.0.1.v200903091627@default:default,org.w3c.dom.svg@default:default"/> <stringAttribute key="target_bundles" value="bcpkix@default:default,bcprov@default:default,ca.odell.glazedlists@default:default,ch.ethz.iks.r_osgi.remote@default:default,com.google.gson@default:default,com.google.guava@default:default,com.google.inject.multibindings@default:false,com.google.inject@default:default,com.ibm.icu@default:default,com.jcraft.jsch@default:default,com.spotify.docker-client.shaded@default:default,com.sun.jersey@default:default,com.sun.syndication@default:default,gov.lbnl.visit.swt@default:default,javax.activation@default:default,javax.el@default:default,javax.inject@default:default,javax.servlet.jsp@default:default,javax.servlet@default:default,javax.ws.rs@default:default,javax.xml@default:default,org.antlr.runtime*3.2.0.v201101311130@default:default,org.antlr.runtime*4.3.0.v201502022030@default:default,org.apache.ant@default:default,org.apache.batik.css*1.7.0.v201011041433@default:default,org.apache.batik.util*1.7.0.v201011041433@default:default,org.apache.batik.util.gui*1.7.0.v200903091627@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.io@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.logging*1.0.4.v201101211617@default:default,org.apache.commons.logging*1.1.1.v201101211721@default:default,org.apache.commons.math@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.log4j@default:default,org.apache.lucene.analysis@default:default,org.apache.lucene.core@default:default,org.eclipse.ant.core@default:default,org.eclipse.cdt.core.linux.x86_64@default:false,org.eclipse.cdt.core.linux@default:false,org.eclipse.cdt.core.native@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.core.net@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.debug.core@default:default,org.eclipse.draw2d@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.swt.gtk@default:false,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.eavp.geometry.view.model@default:default,org.eclipse.eavp.viz.datastructures@default:default,org.eclipse.eavp.viz.modeling@default:default,org.eclipse.eavp.viz.service.mesh@default:default,org.eclipse.eavp.viz.service.visit@default:default,org.eclipse.eavp.viz.service@default:default,org.eclipse.eavp.viz@default:default,org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.osgi.services.distribution@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin@default:default,org.eclipse.ecf.provider.discovery@default:default,org.eclipse.ecf.provider.filetransfer.httpclient4.ssl@default:false,org.eclipse.ecf.provider.filetransfer.httpclient4@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.ecf.provider.r_osgi@default:default,org.eclipse.ecf.provider.remoteservice@default:default,org.eclipse.ecf.provider@default:default,org.eclipse.ecf.remoteservice.asyncproxy*1.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.asyncproxy*2.0.100.v20150702-1411@default:default,org.eclipse.ecf.remoteservice.rest.synd@default:default,org.eclipse.ecf.remoteservice.rest@default:default,org.eclipse.ecf.remoteservice.servlet@default:default,org.eclipse.ecf.remoteservice.soap@default:default,org.eclipse.ecf.remoteservice@default:default,org.eclipse.ecf.sharedobject@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.ecf@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.http.jetty@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.equinox.http.servletbridge@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata.repository@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.equinox.p2.transport.ecf@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.region@default:false,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.security@default:default,org.eclipse.equinox.servletbridge@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.equinox.util@default:default,org.eclipse.equinox.weaving.hook@default:false,org.eclipse.fx.osgi@default:false,org.eclipse.help.base@default:default,org.eclipse.help.ui@default:default,org.eclipse.help@default:default,org.eclipse.january.geometry.model@default:default,org.eclipse.january.geometry.xtext.obj@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.jsch.core@default:default,org.eclipse.nebula.visualization.widgets@default:default,org.eclipse.nebula.visualization.xygraph@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services.remoteserviceadmin@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.platform@default:default,org.eclipse.remote.core@default:default,org.eclipse.remote.jsch.core@default:default,org.eclipse.remote.ui@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.swtbot.ant.junit@default:false,org.eclipse.text@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.ui.console@default:default,org.eclipse.ui.editors@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.ide@default:default,org.eclipse.ui.intro@default:default,org.eclipse.ui.navigator@default:default,org.eclipse.ui.trace@default:default,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.ui.views@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.eclipse.wst.jsdt.nashorn.extension@default:false,org.eclipse.xsd@default:default,org.eclipse.xtend.lib.macro@default:default,org.eclipse.xtend.lib@default:default,org.eclipse.xtext.smap@default:default,org.eclipse.xtext.util@default:default,org.eclipse.xtext.xbase.lib@default:default,org.eclipse.xtext@default:default,org.hamcrest.core@default:default,org.jdom@default:default,org.junit@default:default,org.objectweb.asm@default:default,org.slf4j.api@default:default,org.slf4j.impl.log4j12@default:false,org.tukaani.xz@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil*1.0.1.v200903091627@default:default,org.w3c.dom.svg@default:default"/>
<stringAttribute key="timestamp" value="1342815545071"/> <stringAttribute key="timestamp" value="1342815545071"/>
<booleanAttribute key="tracing" value="false"/> <booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/> <booleanAttribute key="useCustomFeatures" value="false"/>
......
...@@ -155,6 +155,12 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -155,6 +155,12 @@ public class Core extends Application implements ICore, BundleActivator {
*/ */
private ServiceRegistration<ICore> registration; private ServiceRegistration<ICore> registration;
/**
* This constant is used by ECF to register the exported interfaces for the
* remote OSGI service.
*/
private static final String OSGI_SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces";
/** /**
* An alternative constructor that allows the Core to be constructed with a * An alternative constructor that allows the Core to be constructed with a
* particular ItemManager. This is used for testing. * particular ItemManager. This is used for testing.
...@@ -170,8 +176,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -170,8 +176,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Set the project location // Set the project location
if (!setupProjectLocation()) { if (!setupProjectLocation()) {
throw new RuntimeException( throw new RuntimeException("ICore Message: Unable to load workspace!");
"ICore Message: Unable to load workspace!");
} }
// Set the update lock // Set the update lock
...@@ -192,8 +197,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -192,8 +197,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Set the project location // Set the project location
if (!setupProjectLocation()) { if (!setupProjectLocation()) {
throw new RuntimeException( throw new RuntimeException("ICore Message: Unable to load workspace!");
"ICore Message: Unable to load workspace!");
} }
// Set the update lock // Set the update lock
...@@ -246,18 +250,23 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -246,18 +250,23 @@ public class Core extends Application implements ICore, BundleActivator {
itemManager.loadItems(itemDBProject); itemManager.loadItems(itemDBProject);
// Start the webservice! // Start the webservice!
startHttpService(); //startHttpService();
// Configure the remote service properties // Configure the remote service properties
Dictionary<String, String> props = new Hashtable<>(); Dictionary<String, Object> props = new Hashtable<>();
// OSGi Standard Property - indicates which of the interfaces of the // Add OSGi required remote service properties
// service will be exported. '*' means 'all'. props.put(OSGI_SERVICE_EXPORTED_INTERFACES, System.getProperty(OSGI_SERVICE_EXPORTED_INTERFACES, "*"));
props.put("service.exported.interfaces", "*"); // Use ECF generic server config.
// OSGi Standard Property (optional) - indicates which provider
// config(s) will be used to export the service
// (If not explicitly given here, the provider is free to choose a
// default configuration for the service)
props.put("service.exported.configs", "ecf.generic.server"); props.put("service.exported.configs", "ecf.generic.server");
// Setup hostname config (default:localhost)
String hostname = System.getProperty("ecf.generic.server.hostname");
if (hostname != null) {
props.put("ecf.generic.server.hostname", hostname);
}
// Setup port config (default:-1)
props.put("ecf.generic.server.port", new Integer(System.getProperty("ecf.generic.server.port", "-1")));
// Setup IRaspberryPiAsync as async remote service
props.put("ecf.exported.async.interfaces", "*");
// Register this class as a service with the framework. // Register this class as a service with the framework.
if (context != null) { if (context != null) {
...@@ -274,11 +283,9 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -274,11 +283,9 @@ public class Core extends Application implements ICore, BundleActivator {
if (bundleContext != null) { if (bundleContext != null) {
// Grab the service interface // Grab the service interface
matDBServiceRef = bundleContext matDBServiceRef = bundleContext.getServiceReference(IMaterialsDatabase.class);
.getServiceReference(IMaterialsDatabase.class);
// Get the service // Get the service
IMaterialsDatabase database = bundleContext IMaterialsDatabase database = bundleContext.getService(matDBServiceRef);
.getService(matDBServiceRef);
// This should probably be delegated through the ItemManager. // This should probably be delegated through the ItemManager.
AbstractModelBuilder.setMaterialsDatabase(database); AbstractModelBuilder.setMaterialsDatabase(database);
} }
...@@ -321,8 +328,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -321,8 +328,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Register the builder with the ItemManager so long as it is not null // Register the builder with the ItemManager so long as it is not null
if (itemBuilder != null) { if (itemBuilder != null) {
logger.info("ICore Message: Item " + itemBuilder.getItemName() logger.info("ICore Message: Item " + itemBuilder.getItemName() + " registered with Core.");
+ " registered with Core.");
itemManager.registerBuilder(itemBuilder); itemManager.registerBuilder(itemBuilder);
} }
...@@ -339,8 +345,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -339,8 +345,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Register the builder with the ItemManager so long as it is not null // Register the builder with the ItemManager so long as it is not null
if (builder != null) { if (builder != null) {
logger.info("ICore Message: Composite Item " + builder.getItemName() logger.info("ICore Message: Composite Item " + builder.getItemName() + " registered with Core.");
+ " registered with Core.");
itemManager.registerCompositeBuilder(builder); itemManager.registerCompositeBuilder(builder);
} }
...@@ -364,8 +369,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -364,8 +369,7 @@ public class Core extends Application implements ICore, BundleActivator {
@Override @Override
public String createItem(String itemType) { public String createItem(String itemType) {
// This operation retrieves the default "itemDB // This operation retrieves the default "itemDB
IProject project = ResourcesPlugin.getWorkspace().getRoot() IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("itemDB");
.getProject("itemDB");
return createItem(itemType, project); return createItem(itemType, project);
} }
...@@ -387,8 +391,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -387,8 +391,7 @@ public class Core extends Application implements ICore, BundleActivator {
if (itemType != null && project != null) { if (itemType != null && project != null) {
newItemId = itemManager.createItem(itemType, project); newItemId = itemManager.createItem(itemType, project);
} else { } else {
logger.error("Unable to create Item in the core! Type = " + itemType logger.error("Unable to create Item in the core! Type = " + itemType + " , project = " + project);
+ " , project = " + project);
} }
return String.valueOf(newItemId); return String.valueOf(newItemId);
...@@ -476,8 +479,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -476,8 +479,7 @@ public class Core extends Application implements ICore, BundleActivator {
* @see ICore#processItem(int itemId, String actionName, int uniqueClientId) * @see ICore#processItem(int itemId, String actionName, int uniqueClientId)
*/ */
@Override @Override
public FormStatus processItem(int itemId, String actionName, public FormStatus processItem(int itemId, String actionName, int uniqueClientId) {
int uniqueClientId) {
// Local Declarations // Local Declarations
FormStatus status = FormStatus.InfoError; FormStatus status = FormStatus.InfoError;
...@@ -582,18 +584,15 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -582,18 +584,15 @@ public class Core extends Application implements ICore, BundleActivator {
// Grab PSF or XML file // Grab PSF or XML file
if (filename.endsWith(".psf") | filename.endsWith(".xml")) { if (filename.endsWith(".psf") | filename.endsWith(".xml")) {
// Get the file // Get the file
file = project.getFile( file = project.getFile(currentResource.getProjectRelativePath());
currentResource.getProjectRelativePath());
try { try {
// Load the SerializedItemBuilder // Load the SerializedItemBuilder
builder = new SerializedItemBuilder( builder = new SerializedItemBuilder(file.getContents());
file.getContents());
// Register the builder // Register the builder
itemManager.registerBuilder(builder); itemManager.registerBuilder(builder);
} catch (IOException e) { } catch (IOException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
logger.error(getClass().getName() + " Exception!", logger.error(getClass().getName() + " Exception!", e);
e);
status = false; status = false;
} }
} }
...@@ -632,8 +631,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -632,8 +631,7 @@ public class Core extends Application implements ICore, BundleActivator {
// are no longer using Declarative Services. // are no longer using Declarative Services.
if (bundleContext != null) { if (bundleContext != null) {
// Grab the service reference and the service // Grab the service reference and the service
httpServiceRef = bundleContext httpServiceRef = bundleContext.getServiceReference(HttpService.class);
.getServiceReference(HttpService.class);
// If it is good to go, start up the webserver // If it is good to go, start up the webserver
if (httpServiceRef != null) { if (httpServiceRef != null) {
...@@ -645,8 +643,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -645,8 +643,7 @@ public class Core extends Application implements ICore, BundleActivator {
httpService = bundleContext.getService(httpServiceRef); httpService = bundleContext.getService(httpServiceRef);
// Set the parameters // Set the parameters
servletParams.put("javax.ws.rs.Application", servletParams.put("javax.ws.rs.Application", Core.class.getName());
Core.class.getName());
// Register the service // Register the service
try { try {
...@@ -655,8 +652,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -655,8 +652,7 @@ public class Core extends Application implements ICore, BundleActivator {
bundle = bundleContext.getBundle(); bundle = bundleContext.getBundle();
// Make sure we got a valid bundle // Make sure we got a valid bundle
if (bundle == null) { if (bundle == null) {
logger.info( logger.info("ICE Core Bundle was null! No web service started.");
"ICE Core Bundle was null! No web service started.");
return; return;
} }
...@@ -666,14 +662,10 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -666,14 +662,10 @@ public class Core extends Application implements ICore, BundleActivator {
// Resolve the URLs to be absolute // Resolve the URLs to be absolute
resourceURL = FileLocator.resolve(resourceURL); resourceURL = FileLocator.resolve(resourceURL);
configFileURL = FileLocator.resolve(configFileURL); configFileURL = FileLocator.resolve(configFileURL);
HttpContext httpContext = new BasicAuthSecuredContext( HttpContext httpContext = new BasicAuthSecuredContext(resourceURL, configFileURL,
resourceURL, configFileURL,
"ICE Core Server Configuration"); "ICE Core Server Configuration");
httpService.registerServlet("/ice", httpService.registerServlet("/ice", new ServletContainer(this), servletParams, httpContext);
new ServletContainer(this), servletParams, } catch (ServletException | NamespaceException | IOException e) {
httpContext);
} catch (ServletException | NamespaceException
| IOException e) {
logger.error(getClass().getName() + " Exception!", e); logger.error(getClass().getName() + " Exception!", e);
} }
logger.info("ICE Core Server loaded and web service started!"); logger.info("ICE Core Server loaded and web service started!");
...@@ -734,8 +726,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -734,8 +726,7 @@ public class Core extends Application implements ICore, BundleActivator {
// If the project does not exist, create it // If the project does not exist, create it
if (!project.exists()) { if (!project.exists()) {
// Create the project description // Create the project description
IProjectDescription desc = ResourcesPlugin.getWorkspace() IProjectDescription desc = ResourcesPlugin.getWorkspace().newProjectDescription(defaultProjectName);
.newProjectDescription(defaultProjectName);
// Create the project // Create the project
project.create(desc, null); project.create(desc, null);
} }
...@@ -839,13 +830,11 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -839,13 +830,11 @@ public class Core extends Application implements ICore, BundleActivator {
JsonObject messageJsonObject = messageJson.getAsJsonObject(); JsonObject messageJsonObject = messageJson.getAsJsonObject();
// Get the Item id from the json // Get the Item id from the json
JsonPrimitive itemIdJson = messageJsonObject JsonPrimitive itemIdJson = messageJsonObject.getAsJsonPrimitive("item_id");
.getAsJsonPrimitive("item_id");
int itemId = itemIdJson.getAsInt(); int itemId = itemIdJson.getAsInt();
// Get the array of posts from the message // Get the array of posts from the message
JsonArray jsonMessagesList = messageJsonObject JsonArray jsonMessagesList = messageJsonObject.getAsJsonArray("posts");
.getAsJsonArray("posts");
// Load the list // Load the list
for (int i = 0; i < jsonMessagesList.size(); i++) { for (int i = 0; i < jsonMessagesList.size(); i++) {
...@@ -862,8 +851,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -862,8 +851,7 @@ public class Core extends Application implements ICore, BundleActivator {
} }
} catch (JsonParseException e) { } catch (JsonParseException e) {
// Log the message // Log the message
String err = "Core Message: " + "JSON parsing failed for message " String err = "Core Message: " + "JSON parsing failed for message " + messageString;
+ messageString;
logger.error(getClass().getName() + " Exception!", e); logger.error(getClass().getName() + " Exception!", e);
logger.error(err); logger.error(err);
} }
...@@ -887,8 +875,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -887,8 +875,7 @@ public class Core extends Application implements ICore, BundleActivator {
// Print the message if debugging is enabled // Print the message if debugging is enabled
// if (debuggingEnabled) { // if (debuggingEnabled) {
logger.info( logger.info("Core Message: " + "Update received with message: " + message);
"Core Message: " + "Update received with message: " + message);
// } // }
// Only process the message if it exists and is not empty // Only process the message if it exists and is not empty
...@@ -898,8 +885,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -898,8 +885,7 @@ public class Core extends Application implements ICore, BundleActivator {
String[] messageParts = message.split("="); String[] messageParts = message.split("=");
if (messageParts.length > 1) { if (messageParts.length > 1) {
// Get the message object. // Get the message object.
ArrayList<Message> msgList = buildMessagesFromString( ArrayList<Message> msgList = buildMessagesFromString(messageParts[1]);
messageParts[1]);
// Post the messages if there are any. Fail otherwise. // Post the messages if there are any. Fail otherwise.
if (!msgList.isEmpty()) { if (!msgList.isEmpty()) {
for (int i = 0; i < msgList.size(); i++) { for (int i = 0; i < msgList.size(); i++) {
...@@ -933,8 +919,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -933,8 +919,7 @@ public class Core extends Application implements ICore, BundleActivator {
* java.lang.String, org.eclipse.core.resources.IProject) * java.lang.String, org.eclipse.core.resources.IProject)
*/ */
@Override @Override
public String importFileAsItem(URI file, String itemType, public String importFileAsItem(URI file, String itemType, IProject project) {
IProject project) {
// Local Declarations // Local Declarations
int newItemId = -1; int newItemId = -1;
...@@ -945,8 +930,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -945,8 +930,7 @@ public class Core extends Application implements ICore, BundleActivator {
importFile(file, project); importFile(file, project);
// Get the name of the file. This is only created to get the short // Get the name of the file. This is only created to get the short
// name of the file. Then create the Item // name of the file. Then create the Item
newItemId = itemManager.createItem(new File(file).getName(), newItemId = itemManager.createItem(new File(file).getName(), itemType, project);
itemType, project);
} }
return String.valueOf(newItemId); return String.valueOf(newItemId);
...@@ -963,8 +947,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -963,8 +947,7 @@ public class Core extends Application implements ICore, BundleActivator {
// This is an IFile, meaning it came from an existing // This is an IFile, meaning it came from an existing
// IProject, call importFileAsItem with the file URI and its // IProject, call importFileAsItem with the file URI and its
// corresponding IProject // corresponding IProject
return importFileAsItem(file.getLocationURI(), itemType, return importFileAsItem(file.getLocationURI(), itemType, file.getProject());
file.getProject());
} }
/** /**
...@@ -974,11 +957,9 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -974,11 +957,9 @@ public class Core extends Application implements ICore, BundleActivator {
* java.lang.String, java.lang.String) * java.lang.String, java.lang.String)
*/ */
@Override @Override
public String importFileAsItem(URI file, String itemType, public String importFileAsItem(URI file, String itemType, String projectName) {
String projectName) {
// Get the project associated with the project name // Get the project associated with the project name
IProject project = ResourcesPlugin.getWorkspace().getRoot() IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
.getProject(projectName);
// Import it as normal // Import it as normal
return importFileAsItem(file, itemType, project); return importFileAsItem(file, itemType, project);
...@@ -1007,13 +988,12 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -1007,13 +988,12 @@ public class Core extends Application implements ICore, BundleActivator {
@Override @Override
public void importFile(URI file, String projectName) { public void importFile(URI file, String projectName) {
// Local Declarations // Local Declarations
IProject project = ResourcesPlugin.getWorkspace().getRoot() IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
.getProject(projectName);
if (project != null) { if (project != null) {
importFile(file, project); importFile(file, project);
} else { } else {
logger.info("File could not be imported into project " + projectName logger.info(
+ " because the project does not exist."); "File could not be imported into project " + projectName + " because the project does not exist.");
} }
} }
...@@ -1033,8 +1013,7 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -1033,8 +1013,7 @@ public class Core extends Application implements ICore, BundleActivator {
IFile fileInProject = project.getFile(path.lastSegment()); IFile fileInProject = project.getFile(path.lastSegment());
// Get the paths and convert them to strings // Get the paths and convert them to strings
IPath fullPathInProject = fileInProject.getLocation(); IPath fullPathInProject = fileInProject.getLocation();
String path1 = path.toString(), String path1 = path.toString(), path2 = fullPathInProject.toString();
path2 = fullPathInProject.toString();
// Remove devices ids and other such things from the path strings // Remove devices ids and other such things from the path strings
path1 = path1.substring(path1.lastIndexOf(":") + 1); path1 = path1.substring(path1.lastIndexOf(":") + 1);
path2 = path2.substring(path2.lastIndexOf(":") + 1); path2 = path2.substring(path2.lastIndexOf(":") + 1);
...@@ -1050,16 +1029,14 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -1050,16 +1029,14 @@ public class Core extends Application implements ICore, BundleActivator {
fileInProject.delete(true, null); fileInProject.delete(true, null);
} catch (CoreException e) { } catch (CoreException e) {
// Complain and don't do anything else. // Complain and don't do anything else.
logger.info( logger.info("Core Message: " + "Unable to import file.");
"Core Message: " + "Unable to import file.");
logger.error(getClass().getName() + " Exception!", e); logger.error(getClass().getName() + " Exception!", e);
return; return;
} }
} }
try { try {
// Open a stream of the file // Open a stream of the file
FileInputStream fileStream = new FileInputStream( FileInputStream fileStream = new FileInputStream(new File(file));
new File(file));
// Import the file // Import the file
fileInProject.create(fileStream, true, null); fileInProject.create(fileStream, true, null);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
...@@ -1079,12 +1056,10 @@ public class Core extends Application implements ICore, BundleActivator { ...@@ -1079,12 +1056,10 @@ public class Core extends Application implements ICore, BundleActivator {
// Drop some debug info. // Drop some debug info.
if (System.getProperty("DebugICE") != null) { if (System.getProperty("DebugICE") != null) {
logger.info( logger.info("Core Message: " + "Imported file " + file.toString());
"Core Message: " + "Imported file " + file.toString());
} }
} else { } else {
logger.info( logger.info("File could not be imported into project because the File URI was not valid.");
"File could not be imported into project because the File URI was not valid.");
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment