diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-16 10:40:14 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-16 10:40:14 +0000 |
commit | 074cc3cff2f00457318bd322a6bd58f65686ae5c (patch) | |
tree | a3628b8af8e45817be8d4b8d78a5f36c4cb9527b /sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient | |
parent | 40d310c40e8a42abb8757be605ea85f732069a41 (diff) |
Tag for 1.6.1-RC2
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035578 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
3 files changed, 149 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClient.java b/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClient.java new file mode 100644 index 0000000000..59e128b993 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClient.java @@ -0,0 +1,38 @@ +/* + * 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 conversation.referenceclient; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.Remotable; + +import conversation.service.ConversationalService; + +/** + * The client that calls into an existing conversation by accepting + * a reference to that conversation + * + * @version $Rev$ $Date$ + */ + +@Remotable +public interface ConversationalReferenceClient { + + public void incrementCount(CallableReference<ConversationalService> conversationalService); + +} diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientActivator.java b/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientActivator.java new file mode 100644 index 0000000000..ff6f16cba3 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientActivator.java @@ -0,0 +1,66 @@ +/* + * 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 conversation.referenceclient; + +import java.util.Hashtable; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; + +/* + * OSGi bundle activator for conversation tests + */ +public class ConversationalReferenceClientActivator implements BundleActivator, ServiceListener { + + + private BundleContext bundleContext; + + + public void start(BundleContext bc) throws Exception { + + System.out.println("Started OSGiConversationReferenceClientActivator "); + + this.bundleContext = bc; + + bc.addServiceListener(this); + + Hashtable<String, Object> serviceProps; + + serviceProps = new Hashtable<String, Object>(); + serviceProps.put("component.name", "ConversationalReferenceClient"); + ConversationalReferenceClientImpl refClient = new ConversationalReferenceClientImpl(); + bundleContext.registerService(ConversationalReferenceClient.class.getName(), refClient, serviceProps); + + } + + + + public void stop(BundleContext bc) { + } + + public void serviceChanged(ServiceEvent event) { + + if (event.getType() == ServiceEvent.REGISTERED) { + + } + } + +} diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientImpl.java b/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientImpl.java new file mode 100644 index 0000000000..4524c6bd3d --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/osgi-implementation/src/main/java/conversation/referenceclient/ConversationalReferenceClientImpl.java @@ -0,0 +1,45 @@ +/* + * 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 conversation.referenceclient; + +import org.osoa.sca.CallableReference; +import org.osoa.sca.annotations.AllowsPassByReference; +import org.osoa.sca.annotations.Service; + +import conversation.service.ConversationalService; + +/** + * A client component that accepts a reference to an ongoing conversation + * and takes part in that conversation + * + * @version $Rev$ $Date$ + */ + +@Service(interfaces={ConversationalReferenceClient.class}) +@AllowsPassByReference +public class ConversationalReferenceClientImpl implements ConversationalReferenceClient{ + + public void incrementCount(CallableReference<ConversationalService> conversationalService){ + ConversationalService callableReference = conversationalService.getService(); + + callableReference.incrementCount(); + } + + +} |