Return-Path: Delivered-To: apmail-aries-commits-archive@www.apache.org Received: (qmail 1869 invoked from network); 27 Feb 2011 18:29:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Feb 2011 18:29:58 -0000 Received: (qmail 8995 invoked by uid 500); 27 Feb 2011 18:29:57 -0000 Delivered-To: apmail-aries-commits-archive@aries.apache.org Received: (qmail 8333 invoked by uid 500); 27 Feb 2011 18:29:56 -0000 Mailing-List: contact commits-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list commits@aries.apache.org Received: (qmail 8232 invoked by uid 99); 27 Feb 2011 18:29:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Feb 2011 18:29:55 +0000 X-ASF-Spam-Status: No, hits=-1998.3 required=5.0 tests=ALL_TRUSTED,BAD_CREDIT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Feb 2011 18:29:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 635D52388C56; Sun, 27 Feb 2011 18:28:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1075106 [17/18] - in /aries/tags/samples-0.1-incubating: ./ ariestrader/ ariestrader/assemblies/ ariestrader/assemblies/ariestrader-all-eba/ ariestrader/assemblies/ariestrader-jdbc-eba/ ariestrader/assemblies/equinox-test-harness/ ariestra... Date: Sun, 27 Feb 2011 18:28:41 -0000 To: commits@aries.apache.org From: zoe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110227182845.635D52388C56@eris.apache.org> Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/filtered-resources/conf/config.properties URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/filtered-resources/conf/config.properties?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/filtered-resources/conf/config.properties (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/filtered-resources/conf/config.properties Sun Feb 27 18:28:26 2011 @@ -0,0 +1,493 @@ +################################################################################ +# Copyright 2010 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ +############################## +# Felix settings +############################## +org.osgi.framework.storage=./cache/ +org.osgi.framework.startlevel.beginning=10 +felix.startlevel.bundle=10 +org.osgi.framework.storage.clean=onFirstInit +org.osgi.framework.executionenvironment=J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JRE-1.1,JavaSE-1.6,OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2 +org.osgi.framework.system.packages=org.osgi.framework; version=1.5.0, \ + org.osgi.framework.launch; version=1.0.0, \ + org.osgi.framework.hooks.service; version=1.0.0, \ + org.osgi.service.packageadmin; version=1.2.0, \ + org.osgi.service.startlevel; version=1.1.0, \ + org.osgi.service.url; version=1.0.0, \ + org.osgi.util.tracker; version=1.4.0 \ + ${jre-${java.specification.version}} + +# +# Java platform package export properties. +# +jre-1.3=, \ + javax.accessibility; \ + javax.naming; \ + javax.naming.directory; \ + javax.naming.event; \ + javax.naming.ldap; \ + javax.naming.spi; \ + javax.rmi; \ + javax.rmi.CORBA; \ + javax.sound.midi; \ + javax.sound.midi.spi; \ + javax.sound.sampled; \ + javax.sound.sampled.spi; \ + javax.swing; \ + javax.swing.border; \ + javax.swing.colorchooser; \ + javax.swing.event; \ + javax.swing.filechooser; \ + javax.swing.plaf; \ + javax.swing.plaf.basic; \ + javax.swing.plaf.metal; \ + javax.swing.plaf.multi; \ + javax.swing.table; \ + javax.swing.text; \ + javax.swing.text.html; \ + javax.swing.text.html.parser; \ + javax.swing.text.rtf; \ + javax.swing.tree; \ + javax.swing.undo; \ + javax.transaction; \ + org.omg.CORBA; \ + org.omg.CORBA_2_3; \ + org.omg.CORBA_2_3.portable; \ + org.omg.CORBA.DynAnyPackage; \ + org.omg.CORBA.ORBPackage; \ + org.omg.CORBA.portable; \ + org.omg.CORBA.TypeCodePackage; \ + org.omg.CosNaming; \ + org.omg.CosNaming.NamingContextPackage; \ + org.omg.SendingContext; \ + org.omg.stub.java.rmi; \ + version="1.3.0" + +jre-1.4=, \ + javax.accessibility; \ + javax.crypto; \ + javax.crypto.interfaces; \ + javax.crypto.spec; \ + javax.imageio; \ + javax.imageio.event; \ + javax.imageio.metadata; \ + javax.imageio.plugins.jpeg; \ + javax.imageio.spi; \ + javax.imageio.stream; \ + javax.naming; \ + javax.naming.directory; \ + javax.naming.event; \ + javax.naming.ldap; \ + javax.naming.spi; \ + javax.net; \ + javax.net.ssl; \ + javax.print; \ + javax.print.attribute; \ + javax.print.attribute.standard; \ + javax.print.event; \ + javax.rmi; \ + javax.rmi.CORBA; \ + javax.security.auth; \ + javax.security.auth.callback; \ + javax.security.auth.kerberos; \ + javax.security.auth.login; \ + javax.security.auth.spi; \ + javax.security.auth.x500; \ + javax.security.cert; \ + javax.sound.midi; \ + javax.sound.midi.spi; \ + javax.sound.sampled; \ + javax.sound.sampled.spi; \ + javax.sql; \ + javax.swing; \ + javax.swing.border; \ + javax.swing.colorchooser; \ + javax.swing.event; \ + javax.swing.filechooser; \ + javax.swing.plaf; \ + javax.swing.plaf.basic; \ + javax.swing.plaf.metal; \ + javax.swing.plaf.multi; \ + javax.swing.table; \ + javax.swing.text; \ + javax.swing.text.html; \ + javax.swing.text.html.parser; \ + javax.swing.text.rtf; \ + javax.swing.tree; \ + javax.swing.undo; \ + javax.transaction; \ + javax.transaction.xa; \ + javax.xml.parsers; \ + javax.xml.transform; \ + javax.xml.transform.dom; \ + javax.xml.transform.sax; \ + javax.xml.transform.stream; \ + org.ietf.jgss; \ + org.omg.CORBA; \ + org.omg.CORBA_2_3; \ + org.omg.CORBA_2_3.portable; \ + org.omg.CORBA.DynAnyPackage; \ + org.omg.CORBA.ORBPackage; \ + org.omg.CORBA.portable; \ + org.omg.CORBA.TypeCodePackage; \ + org.omg.CosNaming; \ + org.omg.CosNaming.NamingContextExtPackage; \ + org.omg.CosNaming.NamingContextPackage; \ + org.omg.Dynamic; \ + org.omg.DynamicAny; \ + org.omg.DynamicAny.DynAnyFactoryPackage; \ + org.omg.DynamicAny.DynAnyPackage; \ + org.omg.IOP; \ + org.omg.IOP.CodecFactoryPackage; \ + org.omg.IOP.CodecPackage; \ + org.omg.Messaging; \ + org.omg.PortableInterceptor; \ + org.omg.PortableInterceptor.ORBInitInfoPackage; \ + org.omg.PortableServer; \ + org.omg.PortableServer.CurrentPackage; \ + org.omg.PortableServer.POAManagerPackage; \ + org.omg.PortableServer.POAPackage; \ + org.omg.PortableServer.portable; \ + org.omg.PortableServer.ServantLocatorPackage; \ + org.omg.SendingContext; \ + org.omg.stub.java.rmi; \ + org.w3c.dom; \ + org.w3c.dom.css; \ + org.w3c.dom.events; \ + org.w3c.dom.html; \ + org.w3c.dom.stylesheets; \ + org.w3c.dom.traversal; \ + org.w3c.dom.views; \ + org.xml.sax; \ + org.xml.sax.ext; \ + org.xml.sax.helpers; \ + version="1.4.0" + +jre-1.5=, \ + javax.accessibility; \ + javax.activity; \ + javax.crypto; \ + javax.crypto.interfaces; \ + javax.crypto.spec; \ + javax.imageio; \ + javax.imageio.event; \ + javax.imageio.metadata; \ + javax.imageio.plugins.bmp; \ + javax.imageio.plugins.jpeg; \ + javax.imageio.spi; \ + javax.imageio.stream; \ + javax.management; \ + javax.management.loading; \ + javax.management.modelmbean; \ + javax.management.monitor; \ + javax.management.openmbean; \ + javax.management.relation; \ + javax.management.remote; \ + javax.management.remote.rmi; \ + javax.management.timer; \ + javax.naming; \ + javax.naming.directory; \ + javax.naming.event; \ + javax.naming.ldap; \ + javax.naming.spi; \ + javax.net; \ + javax.net.ssl; \ + javax.print; \ + javax.print.attribute; \ + javax.print.attribute.standard; \ + javax.print.event; \ + javax.rmi; \ + javax.rmi.CORBA; \ + javax.rmi.ssl; \ + javax.security.auth; \ + javax.security.auth.callback; \ + javax.security.auth.kerberos; \ + javax.security.auth.login; \ + javax.security.auth.spi; \ + javax.security.auth.x500; \ + javax.security.cert; \ + javax.security.sasl; \ + javax.sound.midi; \ + javax.sound.midi.spi; \ + javax.sound.sampled; \ + javax.sound.sampled.spi; \ + javax.sql; \ + javax.sql.rowset; \ + javax.sql.rowset.serial; \ + javax.sql.rowset.spi; \ + javax.swing; \ + javax.swing.border; \ + javax.swing.colorchooser; \ + javax.swing.event; \ + javax.swing.filechooser; \ + javax.swing.plaf; \ + javax.swing.plaf.basic; \ + javax.swing.plaf.metal; \ + javax.swing.plaf.multi; \ + javax.swing.plaf.synth; \ + javax.swing.table; \ + javax.swing.text; \ + javax.swing.text.html; \ + javax.swing.text.html.parser; \ + javax.swing.text.rtf; \ + javax.swing.tree; \ + javax.swing.undo; \ + javax.transaction; \ + javax.transaction.xa; \ + javax.xml; \ + javax.xml.datatype; \ + javax.xml.namespace; \ + javax.xml.parsers; \ + javax.xml.transform; \ + javax.xml.transform.dom; \ + javax.xml.transform.sax; \ + javax.xml.transform.stream; \ + javax.xml.validation; \ + javax.xml.xpath; \ + org.ietf.jgss; \ + org.omg.CORBA; \ + org.omg.CORBA_2_3; \ + org.omg.CORBA_2_3.portable; \ + org.omg.CORBA.DynAnyPackage; \ + org.omg.CORBA.ORBPackage; \ + org.omg.CORBA.portable; \ + org.omg.CORBA.TypeCodePackage; \ + org.omg.CosNaming; \ + org.omg.CosNaming.NamingContextExtPackage; \ + org.omg.CosNaming.NamingContextPackage; \ + org.omg.Dynamic; \ + org.omg.DynamicAny; \ + org.omg.DynamicAny.DynAnyFactoryPackage; \ + org.omg.DynamicAny.DynAnyPackage; \ + org.omg.IOP; \ + org.omg.IOP.CodecFactoryPackage; \ + org.omg.IOP.CodecPackage; \ + org.omg.Messaging; \ + org.omg.PortableInterceptor; \ + org.omg.PortableInterceptor.ORBInitInfoPackage; \ + org.omg.PortableServer; \ + org.omg.PortableServer.CurrentPackage; \ + org.omg.PortableServer.POAManagerPackage; \ + org.omg.PortableServer.POAPackage; \ + org.omg.PortableServer.portable; \ + org.omg.PortableServer.ServantLocatorPackage; \ + org.omg.SendingContext; \ + org.omg.stub.java.rmi; \ + org.omg.stub.javax.management.remote.rmi; \ + org.w3c.dom; \ + org.w3c.dom.bootstrap; \ + org.w3c.dom.css; \ + org.w3c.dom.events; \ + org.w3c.dom.html; \ + org.w3c.dom.ls; \ + org.w3c.dom.ranges; \ + org.w3c.dom.stylesheets; \ + org.w3c.dom.traversal; \ + org.w3c.dom.views; \ + org.xml.sax; \ + org.xml.sax.ext; \ + org.xml.sax.helpers; \ + version="1.5.0" + +jre-1.6=, \ + javax.accessibility; \ + javax.activation; \ + javax.activity; \ + javax.annotation; \ + javax.annotation.processing; \ + javax.crypto; \ + javax.crypto.interfaces; \ + javax.crypto.spec; \ + javax.imageio; \ + javax.imageio.event; \ + javax.imageio.metadata; \ + javax.imageio.plugins.bmp; \ + javax.imageio.plugins.jpeg; \ + javax.imageio.spi; \ + javax.imageio.stream; \ + javax.jws; \ + javax.jws.soap; \ + javax.lang.model; \ + javax.lang.model.element; \ + javax.lang.model.type; \ + javax.lang.model.util; \ + javax.management; \ + javax.management.loading; \ + javax.management.modelmbean; \ + javax.management.monitor; \ + javax.management.openmbean; \ + javax.management.relation; \ + javax.management.remote; \ + javax.management.remote.rmi; \ + javax.management.timer; \ + javax.naming; \ + javax.naming.directory; \ + javax.naming.event; \ + javax.naming.ldap; \ + javax.naming.spi; \ + javax.net; \ + javax.net.ssl; \ + javax.print; \ + javax.print.attribute; \ + javax.print.attribute.standard; \ + javax.print.event; \ + javax.rmi; \ + javax.rmi.CORBA; \ + javax.rmi.ssl; \ + javax.script; \ + javax.security.auth; \ + javax.security.auth.callback; \ + javax.security.auth.kerberos; \ + javax.security.auth.login; \ + javax.security.auth.spi; \ + javax.security.auth.x500; \ + javax.security.cert; \ + javax.security.sasl; \ + javax.sound.midi; \ + javax.sound.midi.spi; \ + javax.sound.sampled; \ + javax.sound.sampled.spi; \ + javax.sql; \ + javax.sql.rowset; \ + javax.sql.rowset.serial; \ + javax.sql.rowset.spi; \ + javax.swing; \ + javax.swing.border; \ + javax.swing.colorchooser; \ + javax.swing.event; \ + javax.swing.filechooser; \ + javax.swing.plaf; \ + javax.swing.plaf.basic; \ + javax.swing.plaf.metal; \ + javax.swing.plaf.multi; \ + javax.swing.plaf.synth; \ + javax.swing.table; \ + javax.swing.text; \ + javax.swing.text.html; \ + javax.swing.text.html.parser; \ + javax.swing.text.rtf; \ + javax.swing.tree; \ + javax.swing.undo; \ + javax.tools; \ + javax.transaction; \ + javax.transaction.xa; \ + javax.xml; \ + javax.xml.bind; \ + javax.xml.bind.annotation; \ + javax.xml.bind.annotation.adapters; \ + javax.xml.bind.attachment; \ + javax.xml.bind.helpers; \ + javax.xml.bind.util; \ + javax.xml.crypto; \ + javax.xml.crypto.dom; \ + javax.xml.crypto.dsig; \ + javax.xml.crypto.dsig.dom; \ + javax.xml.crypto.dsig.keyinfo; \ + javax.xml.crypto.dsig.spec; \ + javax.xml.datatype; \ + javax.xml.namespace; \ + javax.xml.parsers; \ + javax.xml.soap; \ + javax.xml.stream; \ + javax.xml.stream.events; \ + javax.xml.stream.util; \ + javax.xml.transform; \ + javax.xml.transform.dom; \ + javax.xml.transform.sax; \ + javax.xml.transform.stax; \ + javax.xml.transform.stream; \ + javax.xml.validation; \ + javax.xml.ws; \ + javax.xml.ws.handler; \ + javax.xml.ws.handler.soap; \ + javax.xml.ws.http; \ + javax.xml.ws.soap; \ + javax.xml.ws.spi; \ + javax.xml.xpath; \ + org.ietf.jgss; \ + org.omg.CORBA; \ + org.omg.CORBA_2_3; \ + org.omg.CORBA_2_3.portable; \ + org.omg.CORBA.DynAnyPackage; \ + org.omg.CORBA.ORBPackage; \ + org.omg.CORBA.portable; \ + org.omg.CORBA.TypeCodePackage; \ + org.omg.CosNaming; \ + org.omg.CosNaming.NamingContextExtPackage; \ + org.omg.CosNaming.NamingContextPackage; \ + org.omg.Dynamic; \ + org.omg.DynamicAny; \ + org.omg.DynamicAny.DynAnyFactoryPackage; \ + org.omg.DynamicAny.DynAnyPackage; \ + org.omg.IOP; \ + org.omg.IOP.CodecFactoryPackage; \ + org.omg.IOP.CodecPackage; \ + org.omg.Messaging; \ + org.omg.PortableInterceptor; \ + org.omg.PortableInterceptor.ORBInitInfoPackage; \ + org.omg.PortableServer; \ + org.omg.PortableServer.CurrentPackage; \ + org.omg.PortableServer.POAManagerPackage; \ + org.omg.PortableServer.POAPackage; \ + org.omg.PortableServer.portable; \ + org.omg.PortableServer.ServantLocatorPackage; \ + org.omg.SendingContext; \ + org.omg.stub.java.rmi; \ + org.omg.stub.javax.management.remote.rmi; \ + org.w3c.dom; \ + org.w3c.dom.bootstrap; \ + org.w3c.dom.css; \ + org.w3c.dom.events; \ + org.w3c.dom.html; \ + org.w3c.dom.ls; \ + org.w3c.dom.ranges; \ + org.w3c.dom.stylesheets; \ + org.w3c.dom.traversal; \ + org.w3c.dom.views; \ + org.w3c.dom.xpath; \ + org.xml.sax; \ + org.xml.sax.ext; \ + org.xml.sax.helpers; \ + version=\"1.6.0\" + +############################## +# Log setting +############################## +org.ops4j.pax.logging.DefaultServiceLog.level=INFO + +############################## +# Client bundles to install +############################## +felix.auto.start.1=\ +"file:bundles/org.apache.felix.shell-1.4.2.jar" \ +"file:bundles/org.apache.felix.shell.tui-1.4.1.jar" +felix.auto.start.2=\ +"file:bundles/pax-logging-service-1.4.jar" \ +"file:bundles/pax-logging-api-1.4.jar" \ +"file:bundles/org.apache.felix.eventadmin-1.2.2.jar" \ +"file:bundles/org.apache.felix.configadmin-1.2.4.jar" \ +"file:bundles/org.apache.aries.util-${ariesUtilVersion}.jar" +felix.auto.start.3=\ +"file:bundles/org.apache.aries.blueprint-${ariesBlueprintVersion}.jar" +felix.auto.start.4=\ +"file:bundles/org.apache.aries.jmx.blueprint-${ariesJmxVersion}.jar" +felix.auto.install.10=\ +"file:bundles/org.apache.aries.samples.blueprint.idverifier.server-${version}.jar" \ +"file:bundles/org.apache.aries.samples.blueprint.idverifier.client-${version}.jar" \ +"file:bundles/org.apache.aries.samples.blueprint.idverifier.api-${version}.jar" Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.bat URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.bat?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.bat (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.bat Sun Feb 27 18:28:26 2011 @@ -0,0 +1,21 @@ +@REM ################################################################################ +@REM # Copyright 2010 +@REM # +@REM # Licensed to the Apache Software Foundation (ASF) under one or more +@REM # contributor license agreements. See the NOTICE file distributed with +@REM # this work for additional information regarding copyright ownership. +@REM # The ASF licenses this file to You under the Apache License, Version 2.0 +@REM # (the "License"); you may not use this file except in compliance with +@REM # the License. You may obtain a copy of the License at +@REM # +@REM # http://www.apache.org/licenses/LICENSE-2.0 +@REM # +@REM # Unless required by applicable law or agreed to in writing, software +@REM # distributed under the License is distributed on an "AS IS" BASIS, +@REM # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM # See the License for the specific language governing permissions and +@REM # limitations under the License. +@REM ################################################################################ +@echo off +set JAVA_OPTS=-Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false +java %JAVA_OPTS% -jar bundles/org.apache.felix.main-2.0.4.jar Propchange: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.bat ------------------------------------------------------------------------------ svn:executable = * Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.sh URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.sh?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.sh (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.sh Sun Feb 27 18:28:26 2011 @@ -0,0 +1,21 @@ +#!/bin/sh +################################################################################ +# Copyright 2010 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ +JAVA_OPTS="-Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" +java $JAVA_OPTS -jar bundles/org.apache.felix.main-2.0.4.jar Propchange: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-assembly/src/main/resources/run.sh ------------------------------------------------------------------------------ svn:executable = * Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/pom.xml URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/pom.xml?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/pom.xml (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/pom.xml Sun Feb 27 18:28:26 2011 @@ -0,0 +1,71 @@ + + + 4.0.0 + + org.apache.aries.samples.blueprint.idverifier + idverifier + 0.1-incubating + + + org.apache.aries.samples.blueprint.idverifier.client + Apache Aries Blueprint Sample - ID Verifier Client + bundle + + Example blueprint application to demo inlined managers definitions. + + + + + org.eclipse + osgi + provided + + + org.apache.aries.blueprint + org.apache.aries.blueprint.api + + + org.apache.aries.samples.blueprint.idverifier + org.apache.aries.samples.blueprint.idverifier.api + ${version} + + + org.apache.aries.samples.blueprint.idverifier + org.apache.aries.samples.blueprint.idverifier.server + ${version} + + + + + + + org.apache.felix + maven-bundle-plugin + + + ${pom.artifactId};blueprint.graceperiod:=true;blueprint.timeout:= 60000 + org.apache.aries.samples.blueprint.idverifier.client.IDVerifierClientActivator + + + + + + + Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/BankInfo.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/BankInfo.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/BankInfo.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/BankInfo.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,98 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +/** + * @author forrestxm + * + */ +public class BankInfo { + private String bankname; + private String bankaddress; + private String banklegalpersonname; + private String bankregistrationnumber; + + /** + * @return the bankname + */ + public String getBankname() { + return bankname; + } + /** + * @param bankname the bankname to set + */ + public void setBankname(String bankname) { + this.bankname = bankname; + } + /** + * @return the bandaddress + */ + public String getBankaddress() { + return bankaddress; + } + /** + * @param bandaddress the bandaddress to set + */ + public void setBankaddress(String bankaddress) { + this.bankaddress = bankaddress; + } + /** + * @return the banklegalpersonname + */ + public String getBanklegalpersonname() { + return banklegalpersonname; + } + /** + * @param banklegalpersonname the banklegalpersonname to set + */ + public void setBanklegalpersonname(String banklegalpersonname) { + this.banklegalpersonname = banklegalpersonname; + } + /** + * @return the bankregistrationnumber + */ + public String getBankregistrationnumber() { + return bankregistrationnumber; + } + /** + * @param bankregistrationnumber the bankregistrationnumber to set + */ + public void setBankregistrationnumber(String bankregistrationnumber) { + this.bankregistrationnumber = bankregistrationnumber; + } + @Override + public String toString(){ + System.out.println("********Start of Printing Bank Info**********"); + System.out.println("Bank Name: " + this.getBankname()); + System.out.println("Bank Address: " + this.getBankaddress()); + System.out.println("Bank Legal Person: "+ this.getBanklegalpersonname()); + System.out.println("Bank Reg. Number: "+ this.getBankregistrationnumber()); + System.out.println("********End of Printing Bank Info**********"); + String delimiter = ","; + StringBuffer sb = new StringBuffer(); + sb.append("["); + sb.append("bankname=" + this.getBankname()+ delimiter); + sb.append("bankaddress=" + this.getBankaddress() + delimiter); + sb.append("banklegalpersonname="+ this.getBanklegalpersonname() + delimiter); + sb.append("bankregistrationnumber="+ this.getBankregistrationnumber()); + sb.append("]"); + return sb.toString(); + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditQueryRegistrationListener.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditQueryRegistrationListener.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditQueryRegistrationListener.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditQueryRegistrationListener.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * @author forrestxm + * + */ +public class CreditQueryRegistrationListener { + + public void reg(CreditRecordOperationImpl svcobject, Map props){ + //svcobject.doAfterReg(); + System.out.println("********Registered bean "+svcobject.getClass().getName()+" as a service**********"); + System.out.println("********Start of Printing service properties**************"); + Set keyset = props.keySet(); + Iterator iter = keyset.iterator(); + while(iter.hasNext()){ + Object keyobj = iter.next(); + Object valueobj = props.get(keyobj); + System.out.println(keyobj + "=" + valueobj); + } + System.out.println("********End of Printing service properties**************"); + } + + public void unreg(CreditRecordOperationImpl svcobject, Map props){ + System.out.println("********Unregistering service bean "+svcobject.getClass().getName()+"**********"); + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecord.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecord.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecord.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecord.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,152 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author forrestxm + * + */ +public class CreditRecord { + private String personid; + private String recordNO; + private Date happenedwhen; + private String recordjustification; + private String recorddescription; + + public CreditRecord(){ + + } + + public CreditRecord(String s){ + this(s, ":"); + } + + public CreditRecord(String s, String delimiter) { + convert(s, delimiter); + } + + private void convert(String s, String delimiter) { + String[] pieces = s.split(delimiter); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if (pieces.length == 5) { + this.setPersonid(pieces[0]); + this.setRecordNO(pieces[1]); + try { + this.setHappenedwhen(sdf.parse(pieces[2])); + } catch (ParseException e) { + e.printStackTrace(); + } + this.setRecordjustification(pieces[3]); + this.setRecorddescription(pieces[4]); + } + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "CreditRecord [personid=" + personid + ", recordNO=" + recordNO + + ", recordjustification=" + recordjustification + + ", happenedwhen=" + happenedwhen + ", recorddescription=" + + recorddescription + "]"; + } + + /** + * @return the personid + */ + public String getPersonid() { + return personid; + } + + /** + * @param personid + * the personid to set + */ + public void setPersonid(String personid) { + this.personid = personid; + } + + /** + * @return the recordNO + */ + public String getRecordNO() { + return recordNO; + } + + /** + * @param recordNO + * the recordNO to set + */ + public void setRecordNO(String recordNO) { + this.recordNO = recordNO; + } + + /** + * @return the happenedwhen + */ + public Date getHappenedwhen() { + return happenedwhen; + } + + /** + * @param happenedwhen + * the happenedwhen to set + */ + public void setHappenedwhen(Date happenedwhen) { + this.happenedwhen = happenedwhen; + } + + /** + * @return the recordjustification + */ + public String getRecordjustification() { + return recordjustification; + } + + /** + * @param recordjustification + * the recordjustification to set + */ + public void setRecordjustification(String recordjustification) { + this.recordjustification = recordjustification; + } + + /** + * @return the recorddescription + */ + public String getRecorddescription() { + return recorddescription; + } + + /** + * @param recorddescription + * the recorddescription to set + */ + public void setRecorddescription(String recorddescription) { + this.recorddescription = recorddescription; + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordFactory.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordFactory.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordFactory.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordFactory.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,53 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +/** + * @author forrestxm + * + */ +public class CreditRecordFactory { + public static CreditRecord staticCreateBean(String record) { + staticcount++; + return new CreditRecord(record); + } + + private String targetbeanname; + private static int staticcount = 0; + private static int dynamiccount = 0; + + public CreditRecordFactory(String beanname) { + this.targetbeanname = beanname; + } + + public CreditRecord dynamicCreateBean(String record) { + dynamiccount++; + return new CreditRecord(record); + } + + public void creationStatistics() { + System.out.println("**********Bean factory " + + this.getClass().getSimpleName() + + " says goodbye!************"); + System.out.println("**********I created " + staticcount + " " + + targetbeanname + " with static factory, " + dynamiccount + + " " + targetbeanname + " with dynamic factory.***********"); + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordOperationImpl.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordOperationImpl.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordOperationImpl.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordOperationImpl.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,95 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.aries.samples.blueprint.idverifier.api.CreditRecordOperation; + +/** + * @author forrestxm + * + */ +public class CreditRecordOperationImpl implements CreditRecordOperation { + private CreditRecordStore recordstore; + + + + public CreditRecordOperationImpl(CreditRecordStore recordstore) { + super(); + this.recordstore = recordstore; + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.aries.blueprint.sample.complex.client.CreditRecordOperation + * #add(java.lang.String) + */ + public boolean add(String arecord) { + boolean b = true; + CreditRecord record = new CreditRecord(arecord); + b = recordstore.add(record); + return b; + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.aries.blueprint.sample.complex.client.CreditRecordOperation + * #query(java.lang.String) + */ + public Set query(String personid) { + Set results = new HashSet(); + + if (recordstore.getPersonidindex().contains(personid)){ + Set allrecords = recordstore.getAPersonRecords(personid).getRecords(); + for (CreditRecord arecord : allrecords){ + results.add(arecord.toString()); + } + } + + return results; + } + + /* + * (non-Javadoc) + * + * @see + * org.apache.aries.blueprint.sample.complex.client.CreditRecordOperation + * #remove(java.lang.String) + */ + public boolean remove(String personid, String recordNO) { + boolean b = false; + + Set persons = recordstore.getPersonidindex(); + if (persons.contains(personid)) { + CreditRecord targetproxy = new CreditRecord(); + targetproxy.setPersonid(personid); + targetproxy.setRecordNO(recordNO); + b = recordstore.getAPersonRecords(personid).remove(targetproxy); + } + + return b; + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordStore.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordStore.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordStore.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/CreditRecordStore.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,115 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.util.HashSet; +import java.util.Set; + +/** + * @author forrestxm + * + */ +public class CreditRecordStore { + private Set personidindex; + private Set personrecords; + + public CreditRecordStore(Set records){ + init(records); + } + + void init(Set records){ + personidindex = new HashSet(); + personrecords = new HashSet(); + + for (CreditRecord arecord : records){ + personidindex.add(arecord.getPersonid()); + } + + for (String personid : personidindex){ + personrecords.add(new PersonCreditRecords(personid)); + } + + for (CreditRecord arecord : records){ + PersonCreditRecords target = getAPersonRecords(arecord.getPersonid()); + if ( target != null){ + target.add(arecord); + } + } + } + + public synchronized boolean add(CreditRecord arecord){ + boolean b = false; + + PersonCreditRecords target = getAPersonRecords(arecord.getPersonid()); + if ( target != null){ + b = target.add(arecord); + } else { + PersonCreditRecords apersonrecords = new PersonCreditRecords(arecord.getPersonid()); + apersonrecords.add(arecord); + personrecords.add(apersonrecords); + personidindex.add(arecord.getPersonid()); + b = true; + } + return b; + + } + + public synchronized boolean remove(CreditRecord arecord){ + boolean b = false; + if (personidindex.contains(arecord.getPersonid())) { + PersonCreditRecords target = getAPersonRecords(arecord.getPersonid()); + b = target.remove(arecord); + if (target.isEmpty()){ + personidindex.remove(arecord.getPersonid()); + personrecords.remove(target); + } + } + return b; + } + + + + public PersonCreditRecords getAPersonRecords(String personid){ + PersonCreditRecords result = null; + for (PersonCreditRecords arecord : this.personrecords){ + if (arecord.getPersonid().equals(personid)){ + result = arecord; + break; + } + } + return result; + } + + + + /** + * @return the personidindex + */ + public Set getPersonidindex() { + return personidindex; + } + + /** + * @return the personrecords + */ + public Set getPersonrecords() { + return personrecords; + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDConverter.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDConverter.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDConverter.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDConverter.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,102 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.aries.samples.blueprint.idverifier.client; + +import org.apache.aries.samples.blueprint.idverifier.api.*; +import org.osgi.service.blueprint.container.Converter; +import org.osgi.service.blueprint.container.ReifiedType; + +/** + * @author forrestxm + * + */ +public class IDConverter implements Converter { + + private PersonIDVerifier verifier; + private String personid; + + /* + * (non-Javadoc) + * + * @see + * org.osgi.service.blueprint.container.Converter#canConvert(java.lang.Object + * , org.osgi.service.blueprint.container.ReifiedType) + */ + // @Override + public boolean canConvert(Object sourceObject, ReifiedType targetType) { + boolean canorcannot = false; + String id = null; + if (targetType.getRawClass() == PersonalInfo.class) { + if (sourceObject instanceof RandomIDChoice){ + id = ((RandomIDChoice)sourceObject).getRandomID(); + this.setPersonid(id); + } + //String personid = sourceObject.toString(); + if (this.getPersonid() == null || this.getPersonid().length() != 18) return false; + verifier.setId(this.getPersonid()); + canorcannot = this.verifier.verify(); + } + return canorcannot; + } + + /* + * (non-Javadoc) + * + * @see + * org.osgi.service.blueprint.container.Converter#convert(java.lang.Object, + * org.osgi.service.blueprint.container.ReifiedType) + */ + // @Override + public Object convert(Object sourceObject, ReifiedType targetType) + throws Exception { + return new PersonalInfo(this.getPersonid(), verifier.getArea(), verifier.getBirthday(), verifier.getGender()); + } + + /** + * @return the verifier + */ + public PersonIDVerifier getVerifier() { + return verifier; + } + + /** + * @param verifier + * the verifier to set + */ + public void setVerifier(PersonIDVerifier verifier) { + this.verifier = verifier; + } + + /** + * @return the personid + */ + public String getPersonid() { + return personid; + } + + /** + * @param personid the personid to set + */ + public void setPersonid(String personid) { + this.personid = personid; + } + + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDVerifierClientActivator.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDVerifierClientActivator.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDVerifierClientActivator.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/IDVerifierClientActivator.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.lang.management.ManagementFactory; + +import javax.management.MBeanServer; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + +/** + * @author forrestxm + * + */ +public class IDVerifierClientActivator implements BundleActivator { + MBeanServer mbs; + ServiceRegistration mbsr; + + /* (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundlectx) throws Exception { + + mbs = ManagementFactory.getPlatformMBeanServer(); + mbsr = bundlectx.registerService(MBeanServer.class.getCanonicalName(), mbs, null); + + } + + /* (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundlectx) throws Exception { +// mbs = null; +// mbsr = null; + + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonBankBean.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonBankBean.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonBankBean.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonBankBean.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,158 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +/** + * @author forrestxm + * + */ + +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.util.Set; + +import org.apache.aries.samples.blueprint.idverifier.api.*; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; +import org.osgi.framework.ServiceReference; +import org.osgi.service.blueprint.container.BlueprintContainer; + +public class PersonBankBean { + private PersonalInfo personinfo; + private BankInfo bankinfo; + private String bankinfobeanid; + private CreditRecordOperation cro; + + private BlueprintContainer bpcontainer; + private BundleContext bpbundlecontext; + private ServiceRegistration svcreg4cro; + + public PersonBankBean(PersonalInfo info){ + this.personinfo = info; + } + + /** + * @return the bankinfo + */ + public BankInfo getBankinfo() { + return bankinfo; + } + + /** + * @param bankinfo the bankinfo to set + */ + public void setBankinfo(BankInfo bankinfo) { + this.bankinfo = bankinfo; + } + + /** + * @return the bankinfobeanid + */ + public String getBankinfobeanid() { + return bankinfobeanid; + } + + /** + * @param bankinfobeanid the bankinfobeanid to set + */ + public void setBankinfobeanid(String bankinfobeanid) { + this.bankinfobeanid = bankinfobeanid; + } + + /** + * @return the bpcontainer + */ + public BlueprintContainer getBpcontainer() { + return bpcontainer; + } + + /** + * @param bpcontainer the bpcontainer to set + */ + public void setBpcontainer(BlueprintContainer bpcontainer) { + this.bpcontainer = bpcontainer; + } + + /** + * @return the cro + */ + public CreditRecordOperation getCro() { + return cro; + } + + /** + * @param cro the cro to set + */ + public void setCro(CreditRecordOperation cro) { + this.cro = cro; + } + + /** + * @return the svcreg4cro + */ + public ServiceRegistration getSvcreg4cro() { + return svcreg4cro; + } + + /** + * @param svcreg4cro the svcreg4cro to set + */ + public void setSvcreg4cro(ServiceRegistration svcreg4cro) { + this.svcreg4cro = svcreg4cro; + } + + /** + * @return the bpbundlecontext + */ + public BundleContext getBpbundlecontext() { + return bpbundlecontext; + } + + /** + * @param bpbundlecontext the bpbundlecontext to set + */ + public void setBpbundlecontext(BundleContext bpbundlecontext) { + this.bpbundlecontext = bpbundlecontext; + } + + public void startUp(){ + System.out.println("*******Start of Printing Personal Bank/Credit Information************"); + this.personinfo.toString(); + + // get component instance of BankInfo at runtime + this.setBankinfo((BankInfo)bpcontainer.getComponentInstance(this.getBankinfobeanid())); + this.bankinfo.toString(); + + // get inlined service object from service registration object + ServiceReference svcref = this.svcreg4cro.getReference(); + this.setCro((CreditRecordOperation)this.bpbundlecontext.getService(svcref)); + + Set allcreditrecords = cro.query(this.personinfo.getPersonid()); + if (allcreditrecords.isEmpty()){ + System.out.println("No credit records for id " + this.personinfo.getPersonid()); + } else { + System.out.println("The credit records for id " + this.personinfo.getPersonid() + " are as follows:"); + for (String arecord : allcreditrecords){ + System.out.println(arecord); + } + } + System.out.println("*******End of Printing Personal Bank/Credit Information**************"); + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonCreditRecords.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonCreditRecords.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonCreditRecords.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonCreditRecords.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,101 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.util.HashSet; +import java.util.Set; + +/** + * @author forrestxm + * + */ +public class PersonCreditRecords { + private String personid; + private Set recordNOs; + private Set records; + + public PersonCreditRecords(String personid){ + this.personid = personid; + this.recordNOs = new HashSet(); + this.records = new HashSet(); + } + + public boolean add(CreditRecord arecord){ + boolean b = false; + if (arecord.getPersonid().equals(personid)){ + if (!recordNOs.contains(arecord.getRecordNO())){ + this.recordNOs.add(arecord.getRecordNO()); + b = this.records.add(arecord); + } + } + return b; + } + + public boolean remove(CreditRecord arecord){ + boolean b = false; + if (arecord.getPersonid().equals(this.personid)){ + if (recordNOs.contains(arecord.getRecordNO())){ + this.recordNOs.remove(arecord.getRecordNO()); + b = this.records.remove(getARecord(arecord.getRecordNO())); + } + } + return b; + } + + private CreditRecord getARecord(String recordNO){ + CreditRecord target = null; + for (CreditRecord arecord : getRecords()){ + if (arecord.getRecordNO().equals(recordNO)){ + target = arecord; + break; + } + } + + return target; + } + + public boolean isEmpty(){ + boolean b = false; + b = recordNOs.isEmpty() && records.isEmpty(); + return b; + } + + /** + * @return the personid + */ + public String getPersonid() { + return personid; + } + + /** + * @return the recordNOs + */ + public Set getRecordNOs() { + return recordNOs; + } + + /** + * @return the records + */ + public Set getRecords() { + return records; + } + + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonalInfo.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonalInfo.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonalInfo.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/PersonalInfo.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,113 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + + +/** + * @author forrestxm + * + */ +public class PersonalInfo { + private String personid; + private String area; + private String birthday; + private String gender; + + public PersonalInfo(String personid, String area, String birth, String suffix){ + this.personid = personid; + this.area = area; + this.birthday = birth; + this.gender = suffix; + } + + /** + * @return the personid + */ + public String getPersonid() { + return personid; + } + + /** + * @param personid the personid to set + */ + public void setPersonid(String personid) { + this.personid = personid; + } + + /** + * @return the area_code + */ + public String getArea() { + return area; + } + + /** + * @param areaCode the area_code to set + */ + public void setArea(String areaCode) { + area = areaCode; + } + + /** + * @return the birth_code + */ + public String getBirthday() { + return birthday; + } + + /** + * @param birthCode the birth_code to set + */ + public void setBirthday(String birthCode) { + birthday = birthCode; + } + + /** + * @return the suffix_code + */ + public String getGender() { + return gender; + } + + /** + * @param suffixCode the suffix_code to set + */ + public void setGender(String suffixCode) { + gender = suffixCode; + } + @Override + public String toString(){ + System.out.println("********Start of Printing Personal Info**********"); + System.out.println("Area: " + this.getArea()); + System.out.println("Birthday: " + this.getBirthday()); + System.out.println("Gender: "+ this.getGender()); + System.out.println("********End of Printing Personal Info************"); + String delimiter = ","; + StringBuffer sb = new StringBuffer(); + sb.append("PersonInfo ["); + sb.append("personid="+this.getPersonid()+delimiter); + sb.append("area=" + this.getArea()+ delimiter); + sb.append("birthday=" + this.getBirthday() + delimiter); + sb.append("gender="+ this.getGender()); + sb.append("]"); + return sb.toString(); + + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/RandomIDChoice.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/RandomIDChoice.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/RandomIDChoice.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/RandomIDChoice.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,49 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.util.Random; + +/** + * @author forrestxm + * + */ +public class RandomIDChoice { + private static String[] idarray = { + "310115197011076874", + "310115197011277844", + "110108197710016853", + "11010819541001366X" + }; + + public RandomIDChoice(){ + super(); + } + + public String getRandomID(){ + Random randomintgenerator = new Random(); + int randomint = randomintgenerator.nextInt(1000); + int remain = randomint % idarray.length; + if (remain < 0 || remain > idarray.length - 1) { + remain = randomintgenerator.nextInt(1000) % idarray.length; + } + return idarray[remain]; + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/VerifierServiceReferenceListener.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/VerifierServiceReferenceListener.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/VerifierServiceReferenceListener.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/java/org/apache/aries/samples/blueprint/idverifier/client/VerifierServiceReferenceListener.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,111 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.client; + +import java.util.Map; +import java.util.Set; + + +import org.apache.aries.samples.blueprint.idverifier.api.PersonIDVerifier; +import org.apache.aries.samples.blueprint.idverifier.server.PersonIDVerifierSimpleImpl; +import org.apache.aries.samples.blueprint.idverifier.server.PersonIDVerifierComplexImpl; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +/** + * @author forrestxm + * + */ +public class VerifierServiceReferenceListener { + public void bind(ServiceReference svcref) { + System.out.println("**********" + this.getClass().getSimpleName() + " bind method via ServiceReference!*********"); + // Get specific PersonIDVerifier implementation class + Bundle svcproviderbundle = svcref.getBundle(); + BundleContext svcproviderbundlectx = svcproviderbundle.getBundleContext(); + Object svcbean = svcproviderbundlectx.getService(svcref); + String svcbeanname = null; + if (svcbean instanceof PersonIDVerifierSimpleImpl) { + svcbeanname = ((PersonIDVerifierSimpleImpl)svcbean).getClass().getCanonicalName(); + } else if (svcbean instanceof PersonIDVerifierComplexImpl){ + svcbeanname = ((PersonIDVerifierComplexImpl)svcbean).getClass().getCanonicalName(); + } + System.out.println("Bundle " + svcproviderbundle.getSymbolicName() + " provides this service implemented by " + svcbeanname); + // Print service users information + System.out.println("**********Start of printing service's users**********"); + Bundle[] usingbundles = svcref.getUsingBundles(); + if (usingbundles != null) { + int len = usingbundles.length; + System.out.println("The service has " + len + " users!"); + System.out.println("They are:"); + for (int i = 0; i < len; i++) { + System.out.println(usingbundles[i].getSymbolicName()); + } + System.out.println("All users are printed out!"); + } + System.out.println("**********End of printing service's users**********"); + + } + + public void bind(PersonIDVerifier svc) { + System.out.println("**********This is service object proxy bind method!***********"); + } + + public void unbind(ServiceReference svcref) { + System.out.println("**********" + this.getClass().getSimpleName() + " unbind method via ServiceReference!*********"); + // Get specific PersonIDVerifier implementation class + Bundle svcproviderbundle = svcref.getBundle(); + BundleContext svcproviderbundlectx = svcproviderbundle.getBundleContext(); + Object svcbean = svcproviderbundlectx.getService(svcref); + String svcbeanname = null; + if (svcbean instanceof PersonIDVerifierSimpleImpl) { + svcbeanname = ((PersonIDVerifierSimpleImpl)svcbean).getClass().getCanonicalName(); + } else if (svcbean instanceof PersonIDVerifierComplexImpl){ + svcbeanname = ((PersonIDVerifierComplexImpl)svcbean).getClass().getCanonicalName(); + } + System.out.println("Bundle " + svcproviderbundle.getSymbolicName() + " provides this service implemented by " + svcbeanname); + // Print service users information + System.out.println("**********Start of printing service's users**********"); + Bundle[] usingbundles = svcref.getUsingBundles(); + if (usingbundles != null) { + int len = usingbundles.length; + System.out.println("The service has " + len + " users!"); + System.out.println("They are:"); + for (int i = 0; i < len; i++) { + System.out.println(usingbundles[i].getSymbolicName()); + } + System.out.println("All users are printed out!"); + } + System.out.println("**********End of printing service's users**********"); + + } + + public void unbind(PersonIDVerifier svc, Map props) { + System.out.println("**********This is service object proxy unbind method!***********"); + System.out.println("**********Start of printing service properties***********"); + System.out.println("Service properties are:"); + Set keys = props.keySet(); + for (Object obj : keys) { + Object valueobj = props.get(obj); + System.out.println(obj + "=" + valueobj); + } + System.out.println("**********End of printing service properties***********"); + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/resources/OSGI-INF/blueprint/blueprint-sample-idverifier-client.xml URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/resources/OSGI-INF/blueprint/blueprint-sample-idverifier-client.xml?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/resources/OSGI-INF/blueprint/blueprint-sample-idverifier-client.xml (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-client/src/main/resources/OSGI-INF/blueprint/blueprint-sample-idverifier-client.xml Sun Feb 27 18:28:26 2011 @@ -0,0 +1,137 @@ + + + + Apache Aries Blueprint Sample - ID Verifier Client + + + ID Converter Bean + + + + + + + + + + + + Personal Bank Bean + + + + + + + + + + + + + Inlined service about querying credit records. + + org.apache.aries.samples.blueprint.idverifier.api.CreditRecordOperation + + + + + + + + Inlined service registration bean + + + + Inlined bean for CreditRecordOperation interface implementation + + inlined bean for CreditRecordStore + + + + + + 310115197011076874:003:2009-12-30:good:4rd donation to charity. + + + + + 310115197011076874:004:2009-12-18:good:3rd donation to charity. + + + + + 310115197011277844:001:2009-12-29:good:Donation to charity + + + + + 310115197011277844:002:2009-12-01:bad:No pay to bill. + + + + + 110108197710016853:002:2009-12-02:good:Paied the bill. + + + + + 110108197710016853:001:1977-10-01:good:I'm born. + + + + + 11010819541001366X:001:1954-10-01:good:I'm born. + + + + + + + + + + + + + + + + + 333, Huai Hai Zhong Road, Lu Wan District, Shanghai, China + + + + + + + + + + Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/pom.xml URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/pom.xml?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/pom.xml (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/pom.xml Sun Feb 27 18:28:26 2011 @@ -0,0 +1,64 @@ + + + 4.0.0 + + org.apache.aries.samples.blueprint.idverifier + idverifier + 0.1-incubating + + + org.apache.aries.samples.blueprint.idverifier.server + Apache Aries Blueprint Sample - ID Verifier Server + bundle + + Example blueprint application to demo inlined managers definitions. + + + + + + org.apache.felix + maven-bundle-plugin + + + ${pom.artifactId} + + + + + + + + + org.eclipse + osgi + provided + + + org.apache.aries.blueprint + org.apache.aries.blueprint.api + + + org.apache.aries.samples.blueprint.idverifier + org.apache.aries.samples.blueprint.idverifier.api + ${pom.version} + + + Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/ComplexVerifierRegistrationListener.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/ComplexVerifierRegistrationListener.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/ComplexVerifierRegistrationListener.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/ComplexVerifierRegistrationListener.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,48 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.server; + +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * @author forrestxm + * + */ +public class ComplexVerifierRegistrationListener { + + public void reg(PersonIDVerifierComplexImpl svcobject, Map props){ + //svcobject.doAfterReg(); + System.out.println("********Registered bean "+svcobject.getClass().getName()+" as a service**********"); + System.out.println("********Print service properties**************"); + Set keyset = props.keySet(); + Iterator iter = keyset.iterator(); + while(iter.hasNext()){ + Object keyobj = iter.next(); + Object valueobj = props.get(keyobj); + System.out.println(keyobj + "=" + valueobj); + } + + } + public void unreg(PersonIDVerifierComplexImpl svcobject, Map props){ + System.out.println("********Unregistering service bean "+svcobject.getClass().getName()+"**********"); + } + +} Added: aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/PersonIDVerifierComplexImpl.java URL: http://svn.apache.org/viewvc/aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/PersonIDVerifierComplexImpl.java?rev=1075106&view=auto ============================================================================== --- aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/PersonIDVerifierComplexImpl.java (added) +++ aries/tags/samples-0.1-incubating/blueprint/idverifier/idverifier-server/src/main/java/org/apache/aries/samples/blueprint/idverifier/server/PersonIDVerifierComplexImpl.java Sun Feb 27 18:28:26 2011 @@ -0,0 +1,151 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.aries.samples.blueprint.idverifier.server; + +/** + * @author forrestxm + * + */ + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Map; +import java.util.Set; + +import org.apache.aries.samples.blueprint.idverifier.api.PersonIDVerifier; + +public class PersonIDVerifierComplexImpl extends PersonIDVerifierSimpleImpl + implements PersonIDVerifier { + private String datepattern; + private Map definedAreacode; + private int[] coefficient; + + @Override + public boolean verify() { + boolean b = false; + b = super.isValidID() && super.isValidSuffix() + && this.isValidBirth() && this.isValidArea() + && this.isValidCheckCode(); + return b; + } + + @Override + boolean isValidBirth(){ + String birthdate = toDateFormat(getBirthcode(), "-"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + try { + Date birthday = sdf.parse(birthdate); + SimpleDateFormat sdf_usecustom = new SimpleDateFormat(datepattern); + this.setBirth_str(sdf_usecustom.format(birthday)); + return true; + } catch (ParseException e) { + e.printStackTrace(); + } + return false; + } + + @Override + boolean isValidArea() { + boolean b = false; + if (super.isValidArea() && definedAreacode.containsValue(getAreacode())) { + b = true; + Set keys = definedAreacode.keySet(); + for (String key:keys){ + String value = definedAreacode.get(key); + if (value.equals(getAreacode())){ + super.setArea_str(key); + break; + } + } + } + return b; + } + + public boolean isValidCheckCode() { + boolean b = false; + + int[] codes = this.Char2Number(id.substring(0, 17)); + String[] validcheckcodes = { "1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2" }; + int sum = 0; + for (int i = 0; i < 17; i++) { + sum = sum + codes[i] * coefficient[i]; + } + + int remain = sum % 11; + String checkcode = id.substring(17); + + b = validcheckcodes[remain].equals(checkcode); + return b; + } + + private int[] Char2Number(String id) { + int[] numbers = new int[17]; + for (int i = 0; i < 17; i++) { + numbers[i] = Integer.parseInt(new Character(id.charAt(i)).toString()); + } + return numbers; + } + + /** + * @return the datepattern + */ + public String getDatepattern() { + return datepattern; + } + + /** + * @param datepattern + * the datepattern to set + */ + public void setDatepattern(String datepattern) { + this.datepattern = datepattern; + } + + /** + * @return the definedAreacode + */ + public Map getDefinedAreacode() { + return definedAreacode; + } + + /** + * @param definedAreacode + * the definedAreacode to set + */ + public void setDefinedAreacode(Map definedAreacode) { + this.definedAreacode = definedAreacode; + } + + /** + * @return the coefficient + */ + public int[] getCoefficient() { + return coefficient; + } + + /** + * @param coefficient + * the coefficient to set + */ + public void setCoefficient(int[] coefficient) { + this.coefficient = coefficient; + } + +}