From 07b7dfd1a70ba222b899d9813f8c449dbf3b785f Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:28 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835124 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/itest/callableref/AComponent.java | 39 ------- .../sca/itest/callableref/AComponentImpl.java | 116 --------------------- .../tuscany/sca/itest/callableref/BComponent.java | 30 ------ .../sca/itest/callableref/BComponentImpl.java | 38 ------- .../tuscany/sca/itest/callableref/CComponent.java | 27 ----- .../sca/itest/callableref/CComponentImpl.java | 30 ------ .../tuscany/sca/itest/callableref/DComponent.java | 35 ------- .../sca/itest/callableref/DComponentImpl.java | 67 ------------ 8 files changed, 382 deletions(-) delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java delete mode 100644 branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java (limited to 'branches/sca-java-1.1/itest/callablereferences/src/main/java/org') diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java deleted file mode 100644 index d6b3807d31..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface AComponent { - String foo(); - - String fooB(); - String fooB1(); - - String fooC(); - String fooC1(); - - String fooStringD(); - String fooD(); - - String fooBC(); - - DComponent getDReference(); -} diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java deleted file mode 100644 index 65c9bdad35..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/AComponentImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import java.io.ByteArrayOutputStream; -import java.io.Externalizable; -import java.io.ObjectOutputStream; - -import org.apache.tuscany.sca.core.context.CallableReferenceImpl; -import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary; -import org.osoa.sca.CallableReference; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -@Service(AComponent.class) -public class AComponentImpl implements AComponent { - - @Context - protected ComponentContext componentContext; - - @Reference(name = "bReference") - protected BComponent b; - - @Reference - protected CComponent cReference; - - @Reference - protected ServiceReference cServiceReference; - - @Reference(required=false) - protected DComponent dReference; - - protected DComponent dReference1; - - @Reference(name = "dReference1") - public void setDReference(DComponent dReference) { - this.dReference1 = dReference; - } - - public String foo() { - return "AComponent"; - } - - public String fooB() { - return b.foo(); - } - - public String fooB1() { - CallableReference bRef = componentContext.cast(b); - return bRef.getService().foo(); - } - - public String fooC() { - return cReference.foo(); - } - - public String fooC1() { - return cServiceReference.getService().foo(); - } - - public String fooBC() { - CallableReference cReference = componentContext.getServiceReference(CComponent.class, "cReference"); - return b.fooC(cReference); - } - - public String fooD() { - CallableReference aReference = componentContext.createSelfReference(AComponent.class); - return dReference1.foo(aReference); - } - - /** - * A test case to work out what needs to be done in a transformer to get the - * callable reference across the wire. Let here for interest in case anyone - * is looking for how to get at the innards of callable references - */ - public String fooStringD() { - CallableReference aReference = componentContext.createSelfReference(AComponent.class); - ByteArrayOutputStream bos = null; - - try { - bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(aReference); - } catch (Exception ex) { - System.out.println(ex.toString()); - return null; - } - - String aReferenceString = Base64Binary.encode(bos.toByteArray()); - return dReference1.fooString(aReferenceString); - } - - public DComponent getDReference() { - return dReference; - } - -} diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java deleted file mode 100644 index ade672b0ab..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface BComponent { - - String foo(); - - String fooC(CallableReference cComponent); -} diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java deleted file mode 100644 index 518e77d3a8..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/BComponentImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.annotations.Service; - -@Service(BComponent.class) -public class BComponentImpl implements BComponent { - - public BComponentImpl() { - } - - public String foo() { - return "BComponent"; - } - - public String fooC(CallableReference cReference) { - return "B" + cReference.getService().foo(); - } - -} diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java deleted file mode 100644 index fdf80cc1c8..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponent.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface CComponent { - - String foo(); -} diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java deleted file mode 100644 index cc8ec8f000..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/CComponentImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import org.osoa.sca.annotations.Service; - -@Service(CComponent.class) -public class CComponentImpl implements CComponent { - - public String foo() { - return "CComponent"; - } - -} diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java deleted file mode 100644 index eb8cbbf280..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponent.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import java.io.Externalizable; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.core.context.CallableReferenceImpl; -import org.osoa.sca.CallableReference; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface DComponent { - - String foo(CallableReference aReference); - - String fooString(String aReferenceString); -} diff --git a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java b/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java deleted file mode 100644 index 8117ed9235..0000000000 --- a/branches/sca-java-1.1/itest/callablereferences/src/main/java/org/apache/tuscany/sca/itest/callableref/DComponentImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.tuscany.sca.itest.callableref; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.Externalizable; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; - -import org.apache.tuscany.sca.core.context.CallableReferenceImpl; -import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary; -import org.osoa.sca.CallableReference; -import org.osoa.sca.RequestContext; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Service; - -@Service(DComponent.class) -public class DComponentImpl implements DComponent { - - @Context - protected RequestContext requestContext; - - public String foo(CallableReference aReference) { - try { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(aReference); - ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); - Object obj = ois.readObject(); - aReference = (CallableReference) obj; - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println("Invoking service: " + requestContext.getServiceName()); - return "D" + aReference.getService().foo(); - } - - public String fooString(String aReferenceString) { - CallableReference aReference = null; - try { - ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(Base64Binary.decode(aReferenceString))); - Object obj = ois.readObject(); - aReference = (CallableReference) obj; - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println("Invoking service: " + requestContext.getServiceName()); - return "D" + aReference.getService().foo(); - } -} -- cgit v1.2.3