From: <bh...@us...> - 2008-03-26 14:03:34
|
Revision: 717 http://cishell.svn.sourceforge.net/cishell/?rev=717&view=rev Author: bh2 Date: 2008-03-26 07:03:15 -0700 (Wed, 26 Mar 2008) Log Message: ----------- somewhat updated the reference remoting project to 1.0. It DOES NOT WORK. If we really want this, we'll need to spend actual time on it and maybe even actually use it. Modified Paths: -------------- trunk/clients/remoting/org.cishell.reference.remoting/META-INF/MANIFEST.MF trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/client/DataModelRegistryClient.java trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmFactoryRegistryServer.java trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmRegistryServer.java trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/DataModelRegistryServer.java trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/service/conversion/RemoteDataConversionServiceServer.java trunk/clients/remoting/org.cishell.remoting/META-INF/MANIFEST.MF Modified: trunk/clients/remoting/org.cishell.reference.remoting/META-INF/MANIFEST.MF =================================================================== --- trunk/clients/remoting/org.cishell.reference.remoting/META-INF/MANIFEST.MF 2008-03-26 13:30:42 UTC (rev 716) +++ trunk/clients/remoting/org.cishell.reference.remoting/META-INF/MANIFEST.MF 2008-03-26 14:03:15 UTC (rev 717) @@ -2,18 +2,18 @@ Bundle-ManifestVersion: 2 Bundle-Name: CIShell Client/Server Reference Implementation Bundle-SymbolicName: org.cishell.reference.remoting -Bundle-Version: 0.0.1 -Bundle-Localization: plugin +Bundle-Version: 1.0.0 Service-Component: OSGI-INF/server.xml, OSGI-INF/client.xml X-AutoStart: true Import-Package: org.cishell.app.service.scheduler, - org.cishell.framework, - org.cishell.framework.algorithm, - org.cishell.framework.data, + org.cishell.framework;version="1.0.0", + org.cishell.framework.algorithm;version="1.0.0", + org.cishell.framework.data;version="1.0.0", org.cishell.remoting.service.conversion, org.cishell.remoting.service.framework, - org.cishell.service.conversion, - org.cishell.service.guibuilder, + org.cishell.reference.service.metatype, + org.cishell.service.conversion;version="1.0.0", + org.cishell.service.guibuilder;version="1.0.0", org.knopflerfish.util, org.kobjects.base64, org.ksoap2, Modified: trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/client/DataModelRegistryClient.java =================================================================== --- trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/client/DataModelRegistryClient.java 2008-03-26 13:30:42 UTC (rev 716) +++ trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/client/DataModelRegistryClient.java 2008-03-26 14:03:15 UTC (rev 717) @@ -33,6 +33,7 @@ import org.cishell.reference.remoting.RemotingClient; import org.cishell.remoting.service.conversion.RemoteDataConversionService; import org.cishell.remoting.service.framework.DataModelRegistry; +import org.cishell.service.conversion.ConversionException; import org.cishell.service.conversion.Converter; import org.cishell.service.conversion.DataConversionService; @@ -126,8 +127,8 @@ id = ((RemoteDataModel) dm).dmID; } else { Hashtable properties = null; - if (dm.getMetaData() != null) { - properties = toHashtable(dm.getMetaData()); + if (dm.getMetadata() != null) { + properties = toHashtable(dm.getMetadata()); } else { properties = new Hashtable(); } @@ -166,7 +167,11 @@ format = (String)conversion.get(0); finalOutFormat = (String)conversion.get(1); - dm = converter.convert(dm, format); + try { + dm = converter.convert(dm, format); + } catch (ConversionException e) { + dm = null; + } } } else { dm = null; @@ -283,7 +288,11 @@ Data dm = new BasicData(new Hashtable(), file, inFormat); - dm = convert[0].convert(dm); + try { + dm = convert[0].convert(dm); + } catch (ConversionException e) { + dm = null; + } if (dm != null) { data = dm.getData(); @@ -298,7 +307,7 @@ return data; } - public Dictionary getMetaData() { + public Dictionary getMetadata() { if (properties == null) { properties = reg.getProperties(dmID); } Modified: trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmFactoryRegistryServer.java =================================================================== --- trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmFactoryRegistryServer.java 2008-03-26 13:30:42 UTC (rev 716) +++ trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmFactoryRegistryServer.java 2008-03-26 14:03:15 UTC (rev 717) @@ -23,6 +23,8 @@ import org.cishell.framework.algorithm.Algorithm; import org.cishell.framework.algorithm.AlgorithmFactory; import org.cishell.framework.data.Data; +import org.cishell.reference.service.metatype.BasicMetaTypeProvider; +import org.cishell.reference.service.metatype.BasicObjectClassDefinition; import org.cishell.remoting.service.framework.AlgorithmFactoryRegistry; import org.cishell.remoting.service.framework.AlgorithmRegistry; import org.cishell.remoting.service.framework.DataModelRegistry; @@ -106,13 +108,29 @@ if (factory != null && algReg != null && mtpReg != null && dmReg != null) { Data[] dm = dmReg.getDataModels(dataModelIDs); - MetaTypeProvider mtp = factory.createParameters(dm); + MetaTypeProvider mtp = getMetaTypeProvider(servicePID, dm); mtpID = mtpReg.registerMetaTypeProvider(mtp); } return mtpID; } + //FIXME + private MetaTypeProvider getMetaTypeProvider(String servicePID, Data[] dm) { + try { + String filter = "(" + Constants.SERVICE_PID + "=" + servicePID + ")"; + ServiceReference[] refs = bContext.getServiceReferences(AlgorithmFactory.class.getName(), filter); + + if (refs != null && refs.length == 1) { + + } + } catch (InvalidSyntaxException e) { + + } + + return new BasicMetaTypeProvider(new BasicObjectClassDefinition(servicePID,"","",null)); + } + public Hashtable getProperties(String servicePID) { Hashtable ht = new Hashtable(); Modified: trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmRegistryServer.java =================================================================== --- trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmRegistryServer.java 2008-03-26 13:30:42 UTC (rev 716) +++ trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/AlgorithmRegistryServer.java 2008-03-26 14:03:15 UTC (rev 717) @@ -22,6 +22,7 @@ import org.cishell.app.service.scheduler.SchedulerService; import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.AlgorithmExecutionException; import org.cishell.framework.data.Data; import org.cishell.reference.remoting.ObjectRegistry; import org.cishell.reference.remoting.event.CIShellEventConstants; @@ -136,7 +137,7 @@ this.algorithmID = algorithmID; } - public Data[] execute() { + public Data[] execute() throws AlgorithmExecutionException { return algorithm.execute(); } } Modified: trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/DataModelRegistryServer.java =================================================================== --- trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/DataModelRegistryServer.java 2008-03-26 13:30:42 UTC (rev 716) +++ trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/DataModelRegistryServer.java 2008-03-26 14:03:15 UTC (rev 717) @@ -27,6 +27,7 @@ import org.cishell.framework.data.Data; import org.cishell.reference.remoting.ObjectRegistry; import org.cishell.remoting.service.framework.DataModelRegistry; +import org.cishell.service.conversion.ConversionException; import org.cishell.service.conversion.DataConversionService; import org.osgi.framework.BundleContext; @@ -79,7 +80,11 @@ ciContext.getService(DataConversionService.class.getName()); Data dm = getDataModel(dataModelID); - dm = converter.convert(dm, format); + try { + dm = converter.convert(dm, format); + } catch (ConversionException e1) { + dm = null; + } byte[] data = null; if (dm != null && dm.getData() instanceof File) { @@ -138,7 +143,7 @@ * @see org.cishell.remoting.service.framework.DataModelRegistry#getProperties(String) */ public Hashtable getProperties(String dataModelID) { - return (Hashtable) getDataModel(dataModelID).getMetaData(); + return (Hashtable) getDataModel(dataModelID).getMetadata(); } /** @@ -206,7 +211,7 @@ return null; } - public Dictionary getMetaData() { + public Dictionary getMetadata() { return new Hashtable(); } Modified: trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/service/conversion/RemoteDataConversionServiceServer.java =================================================================== --- trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/service/conversion/RemoteDataConversionServiceServer.java 2008-03-26 13:30:42 UTC (rev 716) +++ trunk/clients/remoting/org.cishell.reference.remoting/src/org/cishell/reference/remoting/server/service/conversion/RemoteDataConversionServiceServer.java 2008-03-26 14:03:15 UTC (rev 717) @@ -23,6 +23,7 @@ import org.cishell.framework.data.Data; import org.cishell.remoting.service.conversion.RemoteDataConversionService; import org.cishell.remoting.service.framework.DataModelRegistry; +import org.cishell.service.conversion.ConversionException; import org.cishell.service.conversion.Converter; import org.cishell.service.conversion.DataConversionService; import org.osgi.framework.BundleContext; @@ -55,7 +56,11 @@ Data dm = dmRegistry.getDataModel(dataModelID); if (dm != null) { - dm = converter.convert(dm, outFormat); + try { + dm = converter.convert(dm, outFormat); + } catch (ConversionException e) { + dm = null; + } if (dm != null) { id = dmRegistry.registerDataModel(dm); Modified: trunk/clients/remoting/org.cishell.remoting/META-INF/MANIFEST.MF =================================================================== --- trunk/clients/remoting/org.cishell.remoting/META-INF/MANIFEST.MF 2008-03-26 13:30:42 UTC (rev 716) +++ trunk/clients/remoting/org.cishell.remoting/META-INF/MANIFEST.MF 2008-03-26 14:03:15 UTC (rev 717) @@ -3,9 +3,8 @@ Bundle-Name: CIShell Remoting API Bundle-SymbolicName: org.cishell.remoting Bundle-Version: 1.0.0 -Bundle-Localization: plugin -Import-Package: org.cishell.framework.algorithm, - org.cishell.framework.data, +Import-Package: org.cishell.framework.algorithm;version="1.0.0", + org.cishell.framework.data;version="1.0.0", org.osgi.service.metatype;version="1.1.0" Export-Package: org.cishell.remoting.service.conversion, org.cishell.remoting.service.framework This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |