From 9f395ebf3ec27f89c8dc63137bc99c8d6b0cff6d Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:37 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835125 13f79535-47bb-0310-9956-ffa450edef68 --- .../itest/conversational/BusinessException.java | 41 --- .../conversational/ConversationIdService.java | 29 -- .../conversational/ConversationalCallback.java | 50 ---- .../itest/conversational/ConversationalClient.java | 51 ---- .../ConversationalReferenceClient.java | 36 --- .../conversational/ConversationalService.java | 58 ---- ...ersationalServiceNonConversationalCallback.java | 59 ---- .../conversational/NonConversationalCallback.java | 44 --- .../impl/ConversationAgeComponentImpl.java | 76 ----- .../impl/ConversationIdComponentImpl.java | 48 --- .../impl/ConversationMaxIdleComponentImpl.java | 76 ----- .../impl/ConversationalClientStatefulImpl.java | 322 --------------------- ...lientStatefulNonConversationalCallbackImpl.java | 311 -------------------- .../impl/ConversationalClientStatelessImpl.java | 318 -------------------- .../impl/ConversationalReferenceClientImpl.java | 43 --- .../impl/ConversationalServiceRequestImpl.java | 124 -------- .../impl/ConversationalServiceStatefulImpl.java | 119 -------- ...rviceStatefulNonConversationalCallbackImpl.java | 118 -------- .../impl/ConversationalServiceStatelessImpl.java | 123 -------- .../ConversationalServiceStatelessScopeImpl.java | 94 ------ 20 files changed, 2140 deletions(-) delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java delete mode 100644 branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java (limited to 'branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany') diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.java deleted file mode 100644 index 4f3a4573fc..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/BusinessException.java +++ /dev/null @@ -1,41 +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.conversational; - -public class BusinessException extends Exception { - - private String message; - - public BusinessException() { - super(); - } - - public BusinessException(String message) { - super(message); - setMessage(message); - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java deleted file mode 100644 index 15c397b902..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationIdService.java +++ /dev/null @@ -1,29 +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.conversational; - -import org.osoa.sca.annotations.Conversational; - -@Conversational -public interface ConversationIdService { - - String getCIDField(); - String getCIDSetter(); -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java deleted file mode 100644 index b1dc926318..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalCallback.java +++ /dev/null @@ -1,50 +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.conversational; - -import org.osoa.sca.annotations.Conversational; -import org.osoa.sca.annotations.EndsConversation; -import org.osoa.sca.annotations.Remotable; - - -/** - * The callback interface used when testing caonversational callbacks - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Remotable -@Conversational -public interface ConversationalCallback { - - // public void init(); - - // public void destroy(); - - public void initializeCount(int count); - - public void incrementCount(); - - public int retrieveCount(); - - public void businessException() throws BusinessException; - - @EndsConversation - public String endConversation(); - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java deleted file mode 100644 index a5b7fd9e1a..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalClient.java +++ /dev/null @@ -1,51 +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.conversational; - -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Remotable; - -/** - * The client for the conversational itest. Is implemented by clients - * offering both stateless and stateful callbacks - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ - -@Remotable -public interface ConversationalClient { - - public int runConversationFromInjectedReference(); - public int runConversationFromInjectedReference2(); - public int runConversationFromServiceReference(); - public int runConversationWithUserDefinedConversationId(); - public String runConversationCheckUserDefinedConversationId(); - public int runConversationCheckingScope(); - public int runConversationWithCallback(); - public int runConversationHavingPassedReference(); - public String runConversationBusinessException(); - public String runConversationBusinessExceptionCallback(); - public int runConversationCallingEndedConversation(); - public int runConversationCallingEndedConversationCallback(); - public String runConversationCallingEndedConversationCheckConversationId(); - public String runConversationCallingEndedConversationCallbackCheckConversationId(); - public int runConversationAgeTimeout(); - public int runConversationIdleTimeout(); - public int runConversationPrincipleError(); -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java deleted file mode 100644 index 6f8d2d0b6f..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalReferenceClient.java +++ /dev/null @@ -1,36 +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.conversational; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.annotations.Remotable; - -/** - * The client that calls into an existing conversation by accepting - * a reference to that conversation - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ - -@Remotable -public interface ConversationalReferenceClient { - - public void incrementCount(CallableReference conversationalService); - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java deleted file mode 100644 index 3a6f8fb97f..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalService.java +++ /dev/null @@ -1,58 +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.conversational; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Conversational; -import org.osoa.sca.annotations.EndsConversation; -import org.osoa.sca.annotations.Remotable; - - -/** - * The service interface used when testing conversations - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Remotable -@Conversational -@Callback(ConversationalCallback.class) -public interface ConversationalService { - - public void initializeCount(int count); - - public void incrementCount(); - - public int retrieveCount(); - - //public void businessException() throws BusinessException; - - public void initializeCountCallback(int count); - - public void incrementCountCallback(); - - public int retrieveCountCallback(); - - //public void businessExceptionCallback() throws BusinessException; - - @EndsConversation - public String endConversation(); - - public String endConversationCallback(); - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java deleted file mode 100644 index 580c404448..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/ConversationalServiceNonConversationalCallback.java +++ /dev/null @@ -1,59 +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.conversational; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Conversational; -import org.osoa.sca.annotations.EndsConversation; -import org.osoa.sca.annotations.Remotable; - - -/** - * The service interface used when testing conversations - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Remotable -@Conversational -@Callback(NonConversationalCallback.class) -public interface ConversationalServiceNonConversationalCallback { - - - public void initializeCount(int count); - - public void incrementCount(); - - public int retrieveCount(); - - public void businessException() throws BusinessException; - - public void initializeCountCallback(int count); - - public void incrementCountCallback(); - - public int retrieveCountCallback(); - - public void businessExceptionCallback() throws BusinessException; - - @EndsConversation - public String endConversation(); - - public String endConversationCallback(); - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java deleted file mode 100644 index 0db328b3d8..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/NonConversationalCallback.java +++ /dev/null @@ -1,44 +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.conversational; - -import org.osoa.sca.annotations.Conversational; -import org.osoa.sca.annotations.EndsConversation; -import org.osoa.sca.annotations.Remotable; - - -/** - * The callback interface used when testing caonversational callbacks - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Remotable -public interface NonConversationalCallback { - - public void initializeCount(int count); - - public void incrementCount(); - - public int retrieveCount(); - - public void businessException() throws BusinessException; - - public String endConversation(); - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java deleted file mode 100644 index a3b76352bd..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationAgeComponentImpl.java +++ /dev/null @@ -1,76 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.annotations.ConversationAttributes; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(ConversationalService.class) -@Scope("CONVERSATION") -@ConversationAttributes(maxAge="1 seconds") -public class ConversationAgeComponentImpl implements ConversationalService { - - private int count; - - public void businessException() throws BusinessException { - } - - public void businessExceptionCallback() throws BusinessException { - } - - public void destroy() { - } - - public String endConversation() { - return null; - } - - public String endConversationCallback() { - return null; - } - - public void incrementCount() { - } - - public void incrementCountCallback() { - } - - public void init() { - } - - public void initializeCount(int count) { - this.count = count; - } - - public void initializeCountCallback(int count) { - } - - public int retrieveCount() { - return count; - } - - public int retrieveCountCallback() { - return 0; - } - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java deleted file mode 100644 index cffa76186a..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationIdComponentImpl.java +++ /dev/null @@ -1,48 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.ConversationIdService; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(ConversationIdService.class) -@Scope("CONVERSATION") -public class ConversationIdComponentImpl implements ConversationIdService { - - @ConversationID - public String cid; - - private String setterCid; - - public String getCIDField() { - return cid; - } - public String getCIDSetter() { - return setterCid; - } - - - @ConversationID - public void setCID(String cid) { - this.setterCid = cid; - } -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java deleted file mode 100644 index a9d247ed40..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationMaxIdleComponentImpl.java +++ /dev/null @@ -1,76 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.annotations.ConversationAttributes; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(ConversationalService.class) -@Scope("CONVERSATION") -@ConversationAttributes(maxIdleTime="1 seconds") -public class ConversationMaxIdleComponentImpl implements ConversationalService { - - private int count; - - public void businessException() throws BusinessException { - } - - public void businessExceptionCallback() throws BusinessException { - } - - public void destroy() { - } - - public String endConversation() { - return null; - } - - public String endConversationCallback() { - return null; - } - - public void incrementCount() { - } - - public void incrementCountCallback() { - } - - public void init() { - } - - public void initializeCount(int count) { - this.count = count; - } - - public void initializeCountCallback(int count) { - } - - public int retrieveCount() { - return count; - } - - public int retrieveCountCallback() { - return 0; - } - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java deleted file mode 100644 index 0b50bae846..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulImpl.java +++ /dev/null @@ -1,322 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; -import org.apache.tuscany.sca.itest.conversational.ConversationalClient; -import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.ConversationAttributes; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -/** - * The client for the conversational itest which presents a stateful - * callback interface - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ - -@Service(interfaces={ConversationalClient.class}) -@Scope("CONVERSATION") -@ConversationAttributes(maxAge="10 minutes", - maxIdleTime="5 minutes", - singlePrincipal=false) -public class ConversationalClientStatefulImpl implements ConversationalClient, ConversationalCallback { - - @Context - protected ComponentContext componentContext; - - @Reference - protected ConversationalService conversationalService; - - @Reference - protected ConversationalService conversationalService2; - - @Reference - protected ConversationalReferenceClient conversationalReferenceClient; - - private int clientCount = 0; - private int callbackCount = 0; - - - // a static member variable that records the number of times this service is called - public static StringBuffer calls = new StringBuffer(); - - // From ConversationalClient - public int runConversationFromInjectedReference(){ - calls.append("runConversationFromInjectedReference,"); - conversationalService.initializeCount(1); - conversationalService.incrementCount(); - clientCount = conversationalService.retrieveCount(); - conversationalService.endConversation(); - - return clientCount; - } - public int runConversationFromInjectedReference2(){ - calls.append("runConversationFromInjectedReference2,"); - - conversationalService2.initializeCount(1); - conversationalService2.incrementCount(); - - // stick in a call to the first reference to - // make sure the two references don't clash - conversationalService.initializeCount(1); - - clientCount = conversationalService2.retrieveCount(); - conversationalService2.endConversation(); - - // end the conversation through the first reference - conversationalService.endConversation(); - - return clientCount; - } - public int runConversationFromServiceReference(){ - calls.append("runConversationFromServiceReference,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - // serviceReference.getConversation().end(); - - return clientCount; - } - public int runConversationWithUserDefinedConversationId(){ - calls.append("runConversationWithUserDefinedConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation1"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - // serviceReference.getConversation().end(); - - return clientCount; - } - public String runConversationCheckUserDefinedConversationId(){ - calls.append("runConversationCheckUserDefinedConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation2"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - - String clientConversationId = serviceReference.getConversationID().toString(); - String serverConversationId = callableReference.endConversation(); - - if (clientConversationId.equals("MyConversation2") && - serverConversationId.equals("MyConversation2") ) { - return clientConversationId; - } else { - return "client = " + clientConversationId + - "server = " + serverConversationId; - } - - } - public int runConversationCheckingScope(){ - calls.append("runConversationCheckingScope,"); - // run a conversation - return runConversationFromInjectedReference(); - - // test will then use a static method to find out how many times - // init/destroy were called - } - public int runConversationWithCallback(){ - calls.append("runConversationWithCallback,"); - callbackCount = 2; - conversationalService.initializeCountCallback(1); - conversationalService.incrementCountCallback(); - clientCount = conversationalService.retrieveCountCallback(); - conversationalService.endConversationCallback(); - - return clientCount; - } - public int runConversationHavingPassedReference(){ - calls.append("runConversationHavingPassedReference,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - conversationalReferenceClient.incrementCount(serviceReference); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - serviceReference.getConversation().end(); - - return clientCount; - } - public String runConversationBusinessException(){ - calls.append("runConversationbusinessException,"); - try { - conversationalService.initializeCount(1); -// conversationalService.businessException(); - clientCount = conversationalService.retrieveCount(); - conversationalService.endConversation(); - } catch(Exception ex) { - return ex.getMessage(); - } - - return "No Exception Returned"; - } - - public String runConversationBusinessExceptionCallback(){ - calls.append("runConversationbusinessExceptionCallback,"); - try { - conversationalService.initializeCountCallback(1); -// conversationalService.businessExceptionCallback(); - clientCount = conversationalService.retrieveCountCallback(); - conversationalService.endConversationCallback(); - } catch(Exception ex) { - return ex.getMessage(); - } - - return "No Exception Returned"; - } - - public int runConversationCallingEndedConversation(){ - calls.append("runConversationCallingEndedConversation,"); - conversationalService.initializeCount(1); - conversationalService.endConversation(); - return conversationalService.retrieveCount(); - } - - public int runConversationCallingEndedConversationCallback(){ - calls.append("runConversationCallingEndedConversationCallback,"); - conversationalService.initializeCountCallback(1); - conversationalService.endConversationCallback(); - return conversationalService.retrieveCountCallback(); - } - - public String runConversationCallingEndedConversationCheckConversationId(){ - calls.append("runConversationCallingEndedConversationCheckConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation3"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - if (serviceReference.getConversation() ==null ) { - return null; - } else { - return serviceReference.getConversation().getConversationID().toString(); - } - } - - public String runConversationCallingEndedConversationCallbackCheckConversationId(){ - calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation3"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversationCallback(); - - if (serviceReference.getConversation() ==null ) { - return null; - } else { - return serviceReference.getConversation().getConversationID().toString(); - } - } - - public int runConversationAgeTimeout(){ - calls.append("runConversationAgeTimeout,"); - // done in other testing - return clientCount; - } - public int runConversationIdleTimeout(){ - calls.append("runConversationIdleTimeout,"); - // done in other testing - return clientCount; - } - public int runConversationPrincipleError(){ - calls.append("runConversationPrincipleError,"); - // TODO - when policy framework is done - return clientCount; - } - - - // From ConversationalCallback - @Init - public void init(){ - calls.append("init,"); - } - - @Destroy - public void destroy(){ - calls.append("destroy,"); - } - - public void initializeCount(int count){ - calls.append("initializeCount,"); - callbackCount += count; - } - - public void incrementCount(){ - calls.append("incrementCount,"); - callbackCount++; - } - - public int retrieveCount(){ - calls.append("retrieveCount,"); - return callbackCount; - } - - public void businessException() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public String endConversation(){ - calls.append("endConversation,"); - callbackCount = 0; - return null; - } - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java deleted file mode 100644 index 31b2cc7849..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatefulNonConversationalCallbackImpl.java +++ /dev/null @@ -1,311 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalClient; -import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.ConversationAttributes; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -/** - * The client for the conversational itest which presents a stateful - * callback interface - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ - -@Service(interfaces={ConversationalClient.class}) -@Scope("CONVERSATION") -@ConversationAttributes(maxAge="10 minutes", - maxIdleTime="5 minutes", - singlePrincipal=false) -public class ConversationalClientStatefulNonConversationalCallbackImpl implements ConversationalClient, NonConversationalCallback { - - @Context - protected ComponentContext componentContext; - - @Reference - protected ConversationalService conversationalService; - - @Reference - protected ConversationalService conversationalService2; - - @Reference - protected ConversationalReferenceClient conversationalReferenceClient; - - private int clientCount = 0; - private int callbackCount = 0; - - - // a static member variable that records the number of times this service is called - public static StringBuffer calls = new StringBuffer(); - - // From ConversationalClient - public int runConversationFromInjectedReference(){ - calls.append("runConversationFromInjectedReference,"); - conversationalService.initializeCount(1); - conversationalService.incrementCount(); - clientCount = conversationalService.retrieveCount(); - conversationalService.endConversation(); - - return clientCount; - } - public int runConversationFromInjectedReference2(){ - calls.append("runConversationFromInjectedReference2,"); - - conversationalService2.initializeCount(1); - conversationalService2.incrementCount(); - - // stick in a call to the first reference to - // make sure the two references don't clash - conversationalService.initializeCount(1); - - clientCount = conversationalService2.retrieveCount(); - conversationalService2.endConversation(); - - // end the conversation through the first reference - conversationalService.endConversation(); - - return clientCount; - } - public int runConversationFromServiceReference(){ - calls.append("runConversationFromServiceReference,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - // serviceReference.getConversation().end(); - - return clientCount; - } - public int runConversationWithUserDefinedConversationId(){ - calls.append("runConversationWithUserDefinedConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation1"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - // serviceReference.getConversation().end(); - - return clientCount; - } - public String runConversationCheckUserDefinedConversationId(){ - calls.append("runConversationCheckUserDefinedConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation2"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - return callableReference.endConversation(); - - } - public int runConversationCheckingScope(){ - calls.append("runConversationCheckingScope,"); - // run a conversation - return runConversationFromInjectedReference(); - - // test will then use a static method to find out how many times - // init/destroy were called - } - public int runConversationWithCallback(){ - calls.append("runConversationWithCallback,"); - callbackCount = 2; - conversationalService.initializeCountCallback(1); - conversationalService.incrementCountCallback(); - clientCount = conversationalService.retrieveCountCallback(); - conversationalService.endConversationCallback(); - - return clientCount; - } - public int runConversationHavingPassedReference(){ - calls.append("runConversationHavingPassedReference,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - conversationalReferenceClient.incrementCount(serviceReference); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - // serviceReference.getConversation().end(); - - return clientCount; - } - public String runConversationBusinessException(){ - calls.append("runConversationbusinessException,"); - try { - conversationalService.initializeCount(1); -// conversationalService.businessException(); - clientCount = conversationalService.retrieveCount(); - conversationalService.endConversation(); - } catch(Exception ex) { - return ex.getMessage(); - } - - return "No Exception Returned"; - } - - public String runConversationBusinessExceptionCallback(){ - calls.append("runConversationbusinessExceptionCallback,"); - try { - conversationalService.initializeCountCallback(1); -// conversationalService.businessExceptionCallback(); - clientCount = conversationalService.retrieveCountCallback(); - conversationalService.endConversationCallback(); - } catch(Exception ex) { - return ex.getMessage(); - } - - return "No Exception Returned"; - } - - public String runConversationCallingEndedConversationCheckConversationId(){ - calls.append("runConversationCallingEndedConversationCheckConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation3"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - if (serviceReference.getConversation() ==null ) { - return null; - } else { - return serviceReference.getConversation().getConversationID().toString(); - } - } - - public String runConversationCallingEndedConversationCallbackCheckConversationId(){ - calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation3"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversationCallback(); - - if (serviceReference.getConversation() ==null ) { - return null; - } else { - return serviceReference.getConversation().getConversationID().toString(); - } - } - - public int runConversationCallingEndedConversation(){ - calls.append("runConversationCallingEndedConversation,"); - conversationalService.initializeCount(1); - conversationalService.endConversation(); - return conversationalService.retrieveCount(); - } - - public int runConversationCallingEndedConversationCallback(){ - calls.append("runConversationCallingEndedConversationCallback,"); - conversationalService.initializeCountCallback(1); - conversationalService.endConversationCallback(); - return conversationalService.retrieveCountCallback(); - } - - public int runConversationAgeTimeout(){ - calls.append("runConversationAgeTimeout,"); - // done in other testing - return clientCount; - } - public int runConversationIdleTimeout(){ - calls.append("runConversationIdleTimeout,"); - // done in other testing - return clientCount; - } - public int runConversationPrincipleError(){ - calls.append("runConversationPrincipleError,"); - // TODO - when policy framework is done - return clientCount; - } - - - // From ConversationalCallback - @Init - public void init(){ - calls.append("init,"); - } - - @Destroy - public void destroy(){ - calls.append("destroy,"); - } - - public void initializeCount(int count){ - calls.append("initializeCount,"); - callbackCount += count; - } - - public void incrementCount(){ - calls.append("incrementCount,"); - callbackCount++; - } - - public int retrieveCount(){ - calls.append("retrieveCount,"); - return callbackCount; - } - - public void businessException() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public String endConversation(){ - calls.append("endConversation,"); - return null; - } - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java deleted file mode 100644 index d5fe3bbb6c..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalClientStatelessImpl.java +++ /dev/null @@ -1,318 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; -import org.apache.tuscany.sca.itest.conversational.ConversationalClient; -import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * The client for the conversational itest which presents a stateful - * callback interface - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ - -@Service(interfaces={ConversationalClient.class}) -public class ConversationalClientStatelessImpl implements ConversationalClient, ConversationalCallback { - - @Context - protected ComponentContext componentContext; - - @Reference - protected ConversationalService conversationalService; - - @Reference - protected ConversationalService conversationalService2; - - @Reference - protected ConversationalReferenceClient conversationalReferenceClient; - - private int clientCount = 0; - private int callbackCount = 0; - - // a static member variable that records the number of times this service is called - public static StringBuffer calls = new StringBuffer(); - - // From ConversationalClient - public int runConversationFromInjectedReference(){ - calls.append("runConversationFromInjectedReference,"); - conversationalService.initializeCount(1); - conversationalService.incrementCount(); - clientCount = conversationalService.retrieveCount(); - conversationalService.endConversation(); - - return clientCount; - } - public int runConversationFromInjectedReference2(){ - calls.append("runConversationFromInjectedReference2,"); - - // now test the second reference - conversationalService2.initializeCount(1); - conversationalService2.incrementCount(); - - // stick in a call to the first reference to - // make sure the two references don't clash - conversationalService.initializeCount(1); - - clientCount = conversationalService2.retrieveCount(); - conversationalService2.endConversation(); - - // end the conversation through the first reference - conversationalService.endConversation(); - - return clientCount; - } - public int runConversationFromServiceReference(){ - calls.append("runConversationFromServiceReference,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - // serviceReference.getConversation().end(); - - return clientCount; - } - public int runConversationWithUserDefinedConversationId(){ - calls.append("runConversationWithUserDefinedConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation1"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - // serviceReference.getConversation().end(); - - return clientCount; - } - public String runConversationCheckUserDefinedConversationId(){ - calls.append("runConversationCheckUserDefinedConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation2"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - - String clientConversationId = serviceReference.getConversationID().toString(); - String serverConfersationId = callableReference.endConversation(); - - if (clientConversationId.equals("MyConversation2") && - serverConfersationId.equals("MyConversation2") ) { - return clientConversationId; - } else { - return "client = " + clientConversationId + - "server = " + serverConfersationId; - } - } - public int runConversationCheckingScope(){ - calls.append("runConversationCheckingScope,"); - // run a conversation - return runConversationFromInjectedReference(); - - // test will then use a static method to find out how many times - // init/destroy were called - } - public int runConversationWithCallback(){ - calls.append("runConversationWithCallback,"); - conversationalService.initializeCountCallback(1); - conversationalService.incrementCountCallback(); - clientCount = conversationalService.retrieveCountCallback(); - conversationalService.endConversationCallback(); - - return clientCount; - } - - public int runConversationHavingPassedReference(){ - calls.append("runConversationHavingPassedReference,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - conversationalReferenceClient.incrementCount(serviceReference); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - serviceReference.getConversation().end(); - - return clientCount; - } - - public String runConversationBusinessException(){ - calls.append("runConversationbusinessException,"); - try { - conversationalService.initializeCount(1); -// conversationalService.businessException(); - clientCount = conversationalService.retrieveCount(); - conversationalService.endConversation(); - } catch(Exception ex) { - return ex.getMessage(); - } - - return "No Exception Returned"; - } - - public String runConversationBusinessExceptionCallback(){ - calls.append("runConversationbusinessExceptionCallback,"); - try { - conversationalService.initializeCountCallback(1); -// conversationalService.businessExceptionCallback(); - clientCount = conversationalService.retrieveCountCallback(); - conversationalService.endConversationCallback(); - } catch(Exception ex) { - return ex.getMessage(); - } - - return "No Exception Returned"; - } - - public int runConversationCallingEndedConversation(){ - calls.append("runConversationCallingEndedConversation,"); - conversationalService.initializeCount(1); - conversationalService.endConversation(); - return conversationalService.retrieveCount(); - } - - public int runConversationCallingEndedConversationCallback(){ - calls.append("runConversationCallingEndedConversationCallback,"); - conversationalService.initializeCountCallback(1); - conversationalService.endConversationCallback(); - return conversationalService.retrieveCountCallback(); - } - - public String runConversationCallingEndedConversationCheckConversationId(){ - calls.append("runConversationCallingEndedConversationCheckConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation3"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversation(); - - if (serviceReference.getConversation() ==null ) { - return null; - } else { - return serviceReference.getConversation().getConversationID().toString(); - } - } - - public String runConversationCallingEndedConversationCallbackCheckConversationId(){ - calls.append("runConversationCallingEndedConversationCallbackCheckConversationId,"); - ServiceReference serviceReference = componentContext.getServiceReference(ConversationalService.class, - "conversationalService"); - serviceReference.setConversationID("MyConversation3"); - - ConversationalService callableReference = serviceReference.getService(); - - callableReference.initializeCount(1); - callableReference.incrementCount(); - clientCount = callableReference.retrieveCount(); - callableReference.endConversationCallback(); - - if (serviceReference.getConversation() ==null ) { - return null; - } else { - return serviceReference.getConversation().getConversationID().toString(); - } - } - - public int runConversationAgeTimeout(){ - calls.append("runConversationAgeTimeout,"); - // done in other testing - return clientCount; - } - public int runConversationIdleTimeout(){ - calls.append("runConversationIdleTimeout,"); - // done in other testing - return clientCount; - } - public int runConversationPrincipleError(){ - calls.append("runConversationPrincipleError,"); - // TODO - when policy framework is done - return clientCount; - } - - - // From ConversationalCallback - @Init - public void init(){ - calls.append("init,"); - - } - - @Destroy - public void destroy(){ - calls.append("destroy,"); - - } - - public void initializeCount(int count){ - calls.append("initializeCount,"); - callbackCount = 0; - } - - public void incrementCount(){ - calls.append("incrementCount,"); - callbackCount++; - } - - public int retrieveCount(){ - calls.append("retrieveCount,"); - return callbackCount; - } - - public void businessException() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public String endConversation(){ - calls.append("endConversation,"); - callbackCount = 0; - return null; - } - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java deleted file mode 100644 index 9895032f53..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalReferenceClientImpl.java +++ /dev/null @@ -1,43 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.ConversationalReferenceClient; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.CallableReference; -import org.osoa.sca.annotations.Service; - -/** - * A client component that accepts a reference to an ongoing conversation - * and takes part in that conversation - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ - -@Service(interfaces={ConversationalReferenceClient.class}) -public class ConversationalReferenceClientImpl implements ConversationalReferenceClient{ - - public void incrementCount(CallableReference conversationalService){ - ConversationalService callableReference = conversationalService.getService(); - - callableReference.incrementCount(); - } - - -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java deleted file mode 100644 index d83cb65046..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceRequestImpl.java +++ /dev/null @@ -1,124 +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.conversational.impl; - -import java.util.HashMap; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - - -/** - * The service used when testing stateful conversations - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Service(ConversationalService.class) -@Scope("REQUEST") -public class ConversationalServiceRequestImpl implements ConversationalService { - - @ConversationID - protected String conversationId; - - @Callback - protected ConversationalCallback conversationalCallback; - - // static area in which to hold conversational data - private static HashMap conversationalState = new HashMap(); - - // a static member variable that records the number of times this service is called - public static StringBuffer calls = new StringBuffer(); - - @Init - public void init(){ - calls.append("init,"); - } - - @Destroy - public void destroy(){ - calls.append("destroy,"); - } - - public void initializeCount(int count){ - calls.append("initializeCount,"); - Integer conversationalCount = new Integer(count); - conversationalState.put(conversationId, conversationalCount); - } - - public void incrementCount(){ - calls.append("incrementCount,"); - Integer conversationalCount = conversationalState.get(conversationId); - conversationalCount++; - conversationalState.put(conversationId, conversationalCount); - } - - public int retrieveCount(){ - calls.append("retrieveCount,"); - Integer count = conversationalState.get(conversationId); - if (count != null){ - return count.intValue(); - } else { - return -999; - } - } - - public void businessException() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public void initializeCountCallback(int count){ - calls.append("initializeCountCallback,"); - initializeCount(count); - conversationalCallback.initializeCount(count); - } - - public void incrementCountCallback(){ - calls.append("incrementCountCallback,"); - incrementCount(); - conversationalCallback.incrementCount(); - } - - public int retrieveCountCallback(){ - calls.append("retrieveCountCallback,"); - return conversationalCallback.retrieveCount(); - } - - public void businessExceptionCallback() throws BusinessException { - calls.append("businessExceptionCallback,"); - conversationalCallback.businessException(); - } - - public String endConversation(){ - calls.append("endConversation,"); - conversationalState.remove(conversationId); - return conversationId; - } - - public String endConversationCallback(){ - calls.append("endConversationCallback,"); - return conversationalCallback.endConversation(); - } -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java deleted file mode 100644 index be1d4bc4d9..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulImpl.java +++ /dev/null @@ -1,119 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.ConversationAttributes; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - - -/** - * The service used when testing stateful conversations - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Service(ConversationalService.class) -@Scope("CONVERSATION") -@ConversationAttributes(maxAge="10 minutes", - maxIdleTime="5 minutes", - singlePrincipal=false) -public class ConversationalServiceStatefulImpl implements ConversationalService { - - @ConversationID - protected String conversationId; - - @Callback - protected ConversationalCallback conversationalCallback; - - // local count - accumulates during the conversation - private int count = 0; - - // a static member variable that records the number of times this service is called - public static StringBuffer calls = new StringBuffer(); - - @Init - public void init(){ - calls.append("init,"); - } - - @Destroy - public void destroy(){ - calls.append("destroy,"); - } - - public void initializeCount(int count){ - calls.append("initializeCount,"); - this.count = count; - } - - public void incrementCount(){ - calls.append("incrementCount,"); - count++; - } - - public int retrieveCount(){ - calls.append("retrieveCount,"); - return count; - } - - public void businessException() throws BusinessException { - calls.append("businessException,"); - throw new BusinessException("Business Exception"); - } - - public void initializeCountCallback(int count){ - calls.append("initializeCountCallback,"); - this.count = count; - conversationalCallback.initializeCount(count); - } - - public void incrementCountCallback(){ - calls.append("incrementCountCallback,"); - count++; - conversationalCallback.incrementCount(); - } - - public int retrieveCountCallback(){ - calls.append("retrieveCountCallback,"); - return conversationalCallback.retrieveCount(); - } - - public void businessExceptionCallback() throws BusinessException { - calls.append("businessExceptionCallback,"); - conversationalCallback.businessException(); - } - - public String endConversation(){ - calls.append("endConversation,"); - count = 0; - return conversationId; - } - - public String endConversationCallback(){ - calls.append("endConversationCallback,"); - return conversationalCallback.endConversation(); - } -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java deleted file mode 100644 index 514880c37c..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatefulNonConversationalCallbackImpl.java +++ /dev/null @@ -1,118 +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.conversational.impl; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalServiceNonConversationalCallback; -import org.apache.tuscany.sca.itest.conversational.NonConversationalCallback; -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.ConversationAttributes; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - - -/** - * The service used when testing stateful conversations - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Service(ConversationalServiceNonConversationalCallback.class) -@Scope("CONVERSATION") -@ConversationAttributes(maxAge="10 minutes", - maxIdleTime="5 minutes", - singlePrincipal=false) -public class ConversationalServiceStatefulNonConversationalCallbackImpl implements ConversationalServiceNonConversationalCallback { - - @ConversationID - protected String conversationId; - - @Callback - protected NonConversationalCallback nonConversationalCallback; - - // local count - accumulates during the conversation - private int count = 0; - - // a static member variable that records the number of times this service is called - public static StringBuffer calls = new StringBuffer(); - - @Init - public void init(){ - calls.append("init,"); - } - - @Destroy - public void destroy(){ - calls.append("destroy,"); - } - - public void initializeCount(int count){ - calls.append("initializeCount,"); - this.count = count; - } - - public void incrementCount(){ - calls.append("incrementCount,"); - count++; - } - - public int retrieveCount(){ - calls.append("retrieveCount,"); - return count; - } - - public void businessException() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public void initializeCountCallback(int count){ - calls.append("initializeCountCallback,"); - this.count = count; - nonConversationalCallback.initializeCount(count); - } - - public void incrementCountCallback(){ - calls.append("incrementCountCallback,"); - count++; - nonConversationalCallback.incrementCount(); - } - - public int retrieveCountCallback(){ - calls.append("retrieveCountCallback,"); - return nonConversationalCallback.retrieveCount(); - } - - public void businessExceptionCallback() throws BusinessException { - calls.append("businessExceptionCallback,"); - nonConversationalCallback.businessException(); - } - - public String endConversation(){ - calls.append("endConversation,"); - count = 0; - return conversationId; - } - - public String endConversationCallback(){ - calls.append("endConversationCallback,"); - return nonConversationalCallback.endConversation(); - } -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java deleted file mode 100644 index 19724149a3..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessImpl.java +++ /dev/null @@ -1,123 +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.conversational.impl; - -import java.util.HashMap; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalCallback; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - - -/** - * The service used when testing stateful conversations - * - * @version $Rev: 537240 $ $Date: 2007-05-11 18:35:03 +0100 (Fri, 11 May 2007) $ - */ -@Service(ConversationalService.class) -public class ConversationalServiceStatelessImpl implements ConversationalService { - - @ConversationID - protected String conversationId; - - @Callback - protected ConversationalCallback conversationalCallback; - - // static area in which to hold conversational data - private static HashMap conversationalState = new HashMap(); - - // a static member variable that records the number of times this service is called - public static StringBuffer calls = new StringBuffer(); - - @Init - public void init(){ - calls.append("init,"); - } - - @Destroy - public void destroy(){ - calls.append("destroy,"); - } - - public void initializeCount(int count){ - calls.append("initializeCount,"); - Integer conversationalCount = new Integer(count); - conversationalState.put(conversationId, conversationalCount); - } - - public void incrementCount(){ - calls.append("incrementCount,"); - Integer conversationalCount = conversationalState.get(conversationId); - conversationalCount++; - conversationalState.put(conversationId, conversationalCount); - } - - public int retrieveCount(){ - calls.append("retrieveCount,"); - Integer count = conversationalState.get(conversationId); - if (count != null){ - return count.intValue(); - } else { - return -999; - } - } - - public void businessException() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public void initializeCountCallback(int count){ - calls.append("initializeCountCallback,"); - initializeCount(count); - conversationalCallback.initializeCount(count); - } - - public void incrementCountCallback(){ - calls.append("incrementCountCallback,"); - incrementCount(); - conversationalCallback.incrementCount(); - } - - public int retrieveCountCallback(){ - calls.append("retrieveCountCallback,"); - return conversationalCallback.retrieveCount(); - } - - public void businessExceptionCallback() throws BusinessException { - calls.append("businessExceptionCallback,"); - conversationalCallback.businessException(); - } - - public String endConversation(){ - calls.append("endConversation,"); - conversationalState.remove(conversationId); - return conversationId; - } - - public String endConversationCallback(){ - calls.append("endConversationCallback,"); - return conversationalCallback.endConversation(); - } -} diff --git a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java b/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java deleted file mode 100644 index 6ab5e554e4..0000000000 --- a/branches/sca-java-1.2/itest/conversations-ws/src/main/java/org/apache/tuscany/sca/itest/conversational/impl/ConversationalServiceStatelessScopeImpl.java +++ /dev/null @@ -1,94 +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.conversational.impl; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.itest.conversational.BusinessException; -import org.apache.tuscany.sca.itest.conversational.ConversationalService; -import org.osoa.sca.annotations.ConversationID; -import org.osoa.sca.annotations.Service; - -@Service(ConversationalService.class) -public class ConversationalServiceStatelessScopeImpl implements ConversationalService { - - @ConversationID - protected String cid; - - static Map state = new HashMap(); - - public void destroy() { - // TODO Auto-generated method stub - - } - - public String endConversation() { - state.remove(cid); - return cid; - } - - public String endConversationCallback() { - // TODO Auto-generated method stub - return null; - - } - - public void incrementCount() { - state.put(cid, Integer.valueOf(state.get(cid)+1)); - } - - public void businessException() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public void incrementCountCallback() { - // TODO Auto-generated method stub - - } - - public void init() { - // TODO Auto-generated method stub - - } - - public void initializeCount(int count) { - state.put(cid, Integer.valueOf(count)); - } - - public void initializeCountCallback(int count) { - // TODO Auto-generated method stub - - } - - public void businessExceptionCallback() throws BusinessException { - throw new BusinessException("Business Exception"); - } - - public int retrieveCount() { - return state.get(cid); - } - - public int retrieveCountCallback() { - // TODO Auto-generated method stub - return 0; - } - -} -- cgit v1.2.3