You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/03/27 20:49:25 UTC
svn commit: r641958 - in /incubator/tuscany/branches/sca-java-1.2/tutorial:
catalog-ejb/src/main/java/client/ catalog-ejb/src/main/java/services/ejb/
catalog-ejb/src/main/resources/ catalog-ejb/src/main/resources/META-INF/
catalog-mediation/META-INF/ c...
Author: jsdelfino
Date: Thu Mar 27 12:49:22 2008
New Revision: 641958
URL: http://svn.apache.org/viewvc?rev=641958&view=rev
Log:
Changed sample EJB session bean to EJB 2.1, added CORBA TSS config to openejb-jar.xml.
Added:
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBHome.java
- copied unchanged from r641941, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBHome.java
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBRemote.java
- copied unchanged from r641941, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJBRemote.java
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/services/ejb/VegetablesCatalogEJBSessionBean.java
- copied unchanged from r641941, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/ejb/VegetablesCatalogEJBSessionBean.java
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/META-INF/ejb-jar.xml
- copied unchanged from r641941, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/META-INF/ejb-jar.xml
Removed:
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/services/ejb/CatalogEJB.java
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/services/ejb/VegetablesCatalogEJBImpl.java
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/services/ejb/
Modified:
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/client/Client.java
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml
incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java
Modified: incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/client/Client.java?rev=641958&r1=641957&r2=641958&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/client/Client.java (original)
+++ incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/java/client/Client.java Thu Mar 27 12:49:22 2008
@@ -1,11 +1,10 @@
package client;
-import java.util.Properties;
-
-import javax.naming.Context;
import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
-import services.ejb.CatalogEJB;
+import services.ejb.CatalogEJBHome;
+import services.ejb.CatalogEJBRemote;
import services.ejb.Vegetable;
/**
@@ -16,13 +15,11 @@
public class Client {
public static void main(String[] args) throws Exception {
- Properties properties = new Properties();
- properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
- properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201");
- InitialContext context = new InitialContext(/*properties*/);
+ InitialContext context = new InitialContext();
- CatalogEJB catalog = (CatalogEJB)context.lookup("corbaname:iiop:1.2@localhost:1050#VegetablesCatalogEJBRemote");
- //CatalogEJB catalog = (CatalogEJB)context.lookup("java:VegetablesCatalogEJBRemote");
+ Object o = context.lookup("corbaname:iiop:1.2@localhost:1050#VegetablesCatalogEJB");
+ CatalogEJBHome home = (CatalogEJBHome) PortableRemoteObject.narrow(o, CatalogEJBHome.class);
+ CatalogEJBRemote catalog = home.create();
Vegetable items[] = catalog.get();
for (Vegetable item: items) {
Modified: incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml?rev=641958&r1=641957&r2=641958&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml (original)
+++ incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/META-INF/openejb-jar.xml Thu Mar 27 12:49:22 2008
@@ -1,32 +1,75 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
- -->
-<openejb-jar
- xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
- xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
- xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0"
- xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
- xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
- <sys:environment>
- <sys:moduleId>
- <sys:groupId>${pom.groupId}</sys:groupId>
- <sys:artifactId>${pom.artifactId}</sys:artifactId>
- <sys:version>${version}</sys:version>
- <sys:type>jar</sys:type>
- </sys:moduleId>
- </sys:environment>
-</openejb-jar>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
+ xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
+ xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0"
+ xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
+ xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+ <sys:environment>
+ <sys:moduleId>
+ <sys:groupId>${pom.groupId}</sys:groupId>
+ <sys:artifactId>${pom.artifactId}</sys:artifactId>
+ <sys:version>${version}</sys:version>
+ <sys:type>jar</sys:type>
+ </sys:moduleId>
+ <sys:dependencies>
+ <sys:dependency>
+ <sys:groupId>org.apache.geronimo.configs</sys:groupId>
+ <sys:artifactId>j2ee-corba-yoko</sys:artifactId>
+ <sys:version>2.1</sys:version>
+ <sys:type>car</sys:type>
+ </sys:dependency>
+ </sys:dependencies>
+ </sys:environment>
+
+ <enterprise-beans>
+ <session>
+ <ejb-name>VegetablesCatalogEJB</ejb-name>
+ <jndi-name>VegetablesCatalogEJB</jndi-name>
+ <tss-link>IdentityTokenNoSecurity</tss-link>
+ </session>
+ </enterprise-beans>
+
+ <gbean name="IdentityTokenNoSecurity"
+ class="org.apache.geronimo.corba.TSSBeanGBean">
+ <attribute name="POAName">IdentityTokenNoSecurity</attribute>
+ <reference name="Server">
+ <name>UnprotectedServer</name>
+ </reference>
+ <xml-attribute name="tssConfig">
+ <tss:tss
+ xmlns:tss="http://www.openejb.org/xml/ns/corba-tss-config-2.0"
+ xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1">
+ <tss:compoundSecMechTypeList>
+ <tss:compoundSecMech>
+ <tss:sasMech>
+ <tss:identityTokenTypes>
+ <tss:ITTAnonymous />
+ <tss:ITTPrincipalNameGSSUP
+ principal-class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" />
+ <tss:ITTDistinguishedName />
+ <tss:ITTX509CertChain />
+ </tss:identityTokenTypes>
+ </tss:sasMech>
+ </tss:compoundSecMech>
+ </tss:compoundSecMechTypeList>
+ </tss:tss>
+ </xml-attribute>
+ </gbean>
+
+</openejb-jar>
Modified: incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType?rev=641958&r1=641957&r2=641958&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType (original)
+++ incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/VegetablesCatalogEJB.componentType Thu Mar 27 12:49:22 2008
@@ -20,7 +20,7 @@
<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
<service name="CatalogEJB">
- <interface.java interface="services.ejb.CatalogEJB"/>
+ <interface.java interface="services.ejb.CatalogEJBRemote"/>
</service>
</componentType>
Modified: incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite?rev=641958&r1=641957&r2=641958&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite (original)
+++ incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-ejb/src/main/resources/catalog-ejb.composite Thu Mar 27 12:49:22 2008
@@ -24,7 +24,7 @@
<component name="VegetablesCatalogEJB">
<implementation.ejb ejb-link="tutorial-catalog-ejb.jar#VegetablesCatalogEJB"/>
<service name="CatalogEJB">
- <binding.ejb uri="java:VegetablesCatalogEJBRemote"/>
+ <binding.ejb uri="corbaname:iiop:1.2@localhost:1050#VegetablesCatalogEJB"/>
</service>
</component>
Modified: incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml?rev=641958&r1=641957&r2=641958&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml (original)
+++ incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/META-INF/sca-contribution.xml Thu Mar 27 12:49:22 2008
@@ -20,5 +20,6 @@
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:c="http://catalog">
<import.java package="services"/>
+ <import.java package="services.ejb"/>
<deployable composite="c:catalog-mediation"/>
</contribution>
Modified: incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java?rev=641958&r1=641957&r2=641958&view=diff
==============================================================================
--- incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java (original)
+++ incubator/tuscany/branches/sca-java-1.2/tutorial/catalog-mediation/services/mediation/VegetablesCatalogMediationImpl.java Thu Mar 27 12:49:22 2008
@@ -19,20 +19,28 @@
package services.mediation;
+import java.rmi.RemoteException;
+
+import org.osoa.sca.ServiceRuntimeException;
import org.osoa.sca.annotations.Reference;
import services.Catalog;
import services.Item;
-import services.ejb.CatalogEJB;
+import services.ejb.CatalogEJBRemote;
import services.ejb.Vegetable;
public class VegetablesCatalogMediationImpl implements Catalog {
@Reference
- public CatalogEJB catalog;
+ public CatalogEJBRemote catalog;
public Item[] get() {
- Vegetable[] vegetables = catalog.get();
+ Vegetable[] vegetables;
+ try {
+ vegetables = catalog.get();
+ } catch (RemoteException e) {
+ throw new ServiceRuntimeException(e);
+ }
Item[] items = new Item[vegetables.length];
for (int i = 0; i < vegetables.length; i++) {
items[i] = new Item(vegetables[i].getName(), vegetables[i].getPrice());
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org