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: */package org.apache.openejb.client;
17:
18: import java.lang.reflect.Method;
19:
20: import javax.ejb.RemoveException;
21:
22: public class StatelessEJBHomeHandler extends EJBHomeHandler {
23:
24: public StatelessEJBHomeHandler() {
25: }
26:
27: public StatelessEJBHomeHandler(EJBMetaDataImpl ejb,
28: ServerMetaData server, ClientMetaData client) {
29: super (ejb, server, client);
30: }
31:
32: protected Object findX(Method method, Object[] args, Object proxy)
33: throws Throwable {
34: throw new SystemException(new UnsupportedOperationException(
35: "Stateful beans may not have find methods"));
36: }
37:
38: protected Object removeByPrimaryKey(Method method, Object[] args,
39: Object proxy) throws Throwable {
40: throw new ApplicationException(
41: new RemoveException(
42: "Session objects are private resources and do not have primary keys"));
43: }
44:
45: protected Object removeWithHandle(Method method, Object[] args,
46: Object proxy) throws Throwable {
47: // you can't really remove a stateless handle
48: return null;
49: }
50:
51: protected EJBObjectHandler newEJBObjectHandler() {
52: return new StatelessEJBObjectHandler();
53: }
54:
55: }
|