|
???? Apache Tuscany Java SCA FAQ ???????????????
IBM ? Sun ? JDK 1.5 ???Tuscany??????????????
??JDK1.4?Tuscany SCA??????JDK1.5??????????
JDK1.6?XML???????????????????????????????????????????????????????JDK1.6?
javax.xml.stream.FactoryConfigurationError: Provider
javax.xml.stream.XMLInputFactory could not be
instantiated: java.lang.InstantiationException
at
javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:158)
|
???? Apache Tuscany??????Maven??????Maven2.0.5??????????????????????????????????2.0.5?
??Tuscany?SVN????????????????????????????????????trunk?????????????????????????????????????????????????
???????????????????????????????????????????
??????????IDE
????????
cd mytuscanydir
svn checkout [https://svn.apache.org/repos/asf/incubator/tuscany/java/]
|
(????????????)
svn update [https://svn.apache.org/repos/asf/incubator/tuscany/java/]
|
???maven
cd mytuscanydir/sca
mvn clean
|
????maven??????maven???????SCA??
.m2\repository\org\apache\tuscany\sca
|
????sca
??????????????????????????
??itest???????"Java heap space"????itest????????????????????
"MAVEN_OPTS="-Xmx1024m -Xms512m"???sca?pom?1surfire plugin?????
1 https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/pom.xml
????????????????svn????????????
demos
distribution
itest
modules
samples
tools
pom.xml
|
??maven??
mvn??????????????Eclipse
mvn -Peclipse eclipse:eclipse
|
???????".classpath" ? ".project"????????Eclipse????Eclipse?"File/Import/Existing Projects Into Workspace"????????????Eclipse??????????
???????????????????????????????????????????????????????????
?????Eclipse WTP?WebApp???WTP Web?????mvn eclipse:eclipse ?????????? -Dwtpversion=1.5?
mvn -Dwtpversion=1.5 -Peclipse eclipse:eclipse
|
?-Dwtpversion=1.5???Eclipse?? WTP Web????<packaging>war</packaging> ?????????????????WTP Tomcat ? Geronimo Server ???, ???Eclipse???????????
| IBM JDK WSConfidentialityTestCase??????java.lang.ExceptionInInitializerError arising from the base java.security.InvalidKeyException: Public key presented not for certificate signature - ??????? |
???????IBM JDK? jre\lib\security\java.security???????????
#
# List of providers and their preference orders:
#
security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider
security.provider.3=com.ibm.jsse2.IBMJSSEProvider2
security.provider.2=com.ibm.crypto.provider.IBMJCE
security.provider.4=com.ibm.security.jgss.IBMJGSSProvider
security.provider.5=com.ibm.security.cert.IBMCertPath
security.provider.6=com.ibm.security.sasl.IBMSASL
|
???????????maven???????????????????????????????maven settings.xml????????????
<mirrors>
<mirror>
<id>ant.staging</id>
<url>http://people.apache.org/~antelder/tuscany/1.0-RC1a/maven</url>
<mirrorOf>apache.incubator</mirrorOf>
</mirror>
|
settings.xml??home.m2??????????? : "C:\Documents and Settings\Administrator\.m2"??????????????????:settings.xml
Tuscany??JDK logger info, warning ?. ???????logging.properties. Tuscany?????????????JDK?INFO???????????????????logging.properties??????jre/lib????IBM JDK
C:\thedirwhereiinstalledjava\jre\lib\logging properties
|
????????FINE????????
????????????
java.util.logging.ConsoleHandler.level = INFO
|
JDK???????????
| ?Eclipse?Tuscany Java SCA??? |
?????????java???????????
?????JVM??????????????Calculator???
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-calculator.jar;
.calculator.CalculatorClient
Listening for transport dt_socket at address: 8000
3 + 2=5.0
3 - 2=1.0
3 * 2=6.0
3 / 2=1.5
|
????????-X. ????????8000. ? Eclipse????????????debug dialog????"Remote Java Application"??8000????????
????Eclipse??? Tuscany SCA ?????????calculator??
?????????????????windows??????????????????????????????????????????????????????????????????
@Service(interfaces={Interface1.class, Interface2.class, Interface3.class} )
public class ServiceImpl implements Interface1, Interface2, Interface3{
...
}
|
???????????????...
public class ServiceImpl implements ServiceInterface1{
@Reference
ServiceInterface2 serviceReference1;
@Reference
private ServiceInterface2 serviceReference2;
@Reference
protected ServiceInterface2 serviceReference3;
@Reference
public ServiceInterface2 serviceReference4;
...
}
|
???????serviceReference1 ? serviceReference2 ?? null??? SCA "" protected ? public ?????????""??????????@Callback, @ConversationId ? @Context?
???????????SCA??SLSB????????????
???????????????????????????Java ??, XML ??, ??CORBA ??, ???????????????????
????????????????Java???????Java???????????????????JavaJava?????Java???????????????????????????????????????WSDL????WSDLXML?
???????????????????????, ???XML???DOM, StAX ??SDO, ? JAXB ?????????AXIOM??Tuscany????????????
- ?????data mediator interceptor??????????????R?A?????S?B?????????????
???????????AB?????????????????????????????????????????
?????????????????????????????(????)????????????Axis2?RMI??????????????????????Axis2?AXIOM??????????????????AXIOM??????????????????AXIOM???????????????????:
- A ??Java ?? X(java) R
- X ??? R???
- ????? X(java) ??? AXIOM ?? X(axiom)
- X(axiom) ?Axis2???
- Axis2??? X(axiom)?(XML)????
- Axis2?????? XML ????? X(axiom)
- X(axiom) ?Axis2???
- ?????????????? X(axiom) ??? X(java)
- X(java) ??? B???
- B??????????????? X(java)
.???????????????????????:???AAxis2???????Axis2???????B?
????????????????? A ? B?????A ? B ??????????????????????????? A->net ? net->B?
| META-INF/sca-contribution.xml??????? |
SCA ?????? 1.00? 1.10.2.3.?????sca-contribution.xml????????????????????????
??????????contribution?
???????????????????contribution. ??, ??????
/my/contribution/dir/META-INF/sca-contribution.xml
/my/contribution/dir/mycomposite.composite
|
sca-contribution.xml???
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://mycomposite"
xmlns:management="http://mycomposite">
<deployable composite="mycomposite:MyComposite"/>
</contribution>
|
?contribution???mycomposite.composite ??????????mycomposite:MyComposite?, ???????
| META-INF/sca-deployables/ ??????? |
??Tuscany??????, SCA?????????
???????????contribution?
????????????????????/META-INF/sca-deployables/????????
/my/contribution/dir/META-INF/sca-deployables/mycomposite.composite
|
Java SCA 1.0??, SCA ????????????? definitions.xml???????SCA????????With respect to processing, computing aplicable policies and applying them is concerned here is what the Release1.0??:
- ???????????????????????????????????????????
- ???????axis2????binding-ws-axis2itest?????? helloworld-ws-service-secure????ws-security????
- itest ???????"confidentiality intent"???????Tuscany??API????????
- WS-Policy, ??????????
- ??????????sca???'appliesTo'?xpath???????????????? ??????????????
| ??????Axis2 WS ?????'confidentiality' ??? |
- ????????????bouncycastle???. ??????????????? (? IDEA)?
- ??????????Axis2??????????????http://wso2.org/library/234?http://wso2.org/library/174?http://wso2.org/library/255?
- ? ws-binding-axis2?itest? helloworld-ws-service-securedefinitions.xml??????(confidentiality)????Axis2ConfigParam??????????????????????keystore?keystore?????????, ??password callback handler ???
- ???????binding.ws???????bcprov-jdk15-132.jar?classpath??
- JRE????security.policy???????????????Sun?IBM?JRE????? ????
SCA ???????6?:
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-assembly
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-policy
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bindings
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-j
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-c-cpp
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sca-bpel
??????????????????????
???????
http://www.oasis-open.org/archives/sca-assembly/
http://www.oasis-open.org/archives/sca-policy/
http://www.oasis-open.org/archives/sca-bindings/
http://www.oasis-open.org/archives/sca-j/
http://www.oasis-open.org/archives/sca-c-cpp/
http://www.oasis-open.org/archives/sca-bpel/
| What does the promote keyword in the composite file mean? |
An SCA composite can be used as an implementation (implementation.composite) for a component. This is so-called recursive composition. It allows pre-assembled composites to be reused.
"promote" can be used to make services or references declared on a component inside the composite visible for wiring at the composite level. The composite services and references can be then further configured when it's used as a component implementation at outer level.
Hope the following samples help.
<composite name="Composite1" xmlns:ns="http://dummy">
<component name="C1">
<implementation.composite name="ns:Composite2">
<!-- wire ref1 to component C3's service1 -->
<reference name="ref1" target="C3/service1"/>
<!-- configure the service with ws binding -->
<service name="svc1">
<binding.ws .../>
</service>
</component>
</composite>
|
<composite name="Composite2" targetNamespace="http://dummy"
xmlns:ns="http://dummy">
<component name="C2">
<implementation.java class="my.C2Impl">
</component>
<!-- innerService of component C2 is promoted as svc1 -->
<service name="svc1" promote="C2/innerService"/>
<!-- innerReference of component C2 is promoted as ref1 -->
<reference name="ref1" promote="C2/innerReference"/>
</composite>
|
|