01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.bpmscript.jbi.tasklist;
18:
19: import javax.jbi.messaging.ExchangeStatus;
20: import javax.jbi.messaging.MessageExchange;
21: import javax.jbi.messaging.MessagingException;
22:
23: import org.apache.servicemix.MessageExchangeListener;
24: import org.apache.servicemix.components.util.ComponentSupport;
25: import org.apache.servicemix.jbi.messaging.DefaultMarshaler;
26: import org.apache.servicemix.jbi.messaging.PojoMarshaler;
27:
28: public class TaskListComponentOld extends ComponentSupport implements
29: MessageExchangeListener {
30:
31: private ITaskListStore taskListStore = null;
32: private PojoMarshaler marshaler = new DefaultMarshaler();
33:
34: public void onMessageExchange(MessageExchange exchange)
35: throws MessagingException {
36: if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
37: ITaskRequest request = (ITaskRequest) marshaler.unmarshal(
38: exchange, getInMessage(exchange));
39: try {
40: taskListStore.createTask(exchange, request);
41: } catch (TaskListException e) {
42: fail(exchange, e);
43: }
44: }
45: }
46:
47: public ITaskListStore getTaskListStore() {
48: return taskListStore;
49: }
50:
51: public void setTaskListStore(ITaskListStore taskListStore) {
52: this .taskListStore = taskListStore;
53: }
54:
55: public PojoMarshaler getMarshaler() {
56: return marshaler;
57: }
58:
59: public void setMarshaler(PojoMarshaler marshaler) {
60: this.marshaler = marshaler;
61: }
62:
63: }
|