001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.test.stateless;
017:
018: import org.apache.openejb.test.ApplicationException;
019: import org.apache.openejb.test.object.OperationsPolicy;
020:
021: import javax.ejb.SessionContext;
022: import javax.ejb.EJBException;
023: import java.util.Properties;
024: import java.rmi.RemoteException;
025:
026: public class BasicStatelessPojoBean implements
027: BasicStatelessBusinessLocal, BasicStatelessBusinessRemote {
028:
029: /**
030: * Maps to BasicStatelessObject.businessMethod
031: *
032: * @return
033: * @see org.apache.openejb.test.stateless.BasicStatelessObject#businessMethod
034: */
035: public String businessMethod(String text) {
036: StringBuffer b = new StringBuffer(text);
037: return b.reverse().toString();
038: }
039:
040: public void scheduleTimer(String name) {
041: // ejbContext.getTimerService().createTimer(1, name);
042: }
043:
044: public Object echo(Object object) {
045: return object;
046: }
047:
048: /**
049: * Throws an ApplicationException when invoked
050: *
051: */
052: public void throwApplicationException() throws ApplicationException {
053: throw new ApplicationException(
054: "Testing ability to throw Application Exceptions");
055: }
056:
057: /**
058: * Throws a java.lang.NullPointerException when invoked
059: * This is a system exception and should result in the
060: * destruction of the instance and invalidation of the
061: * remote reference.
062: *
063: */
064: public void throwSystemException_NullPointer() {
065: throw new NullPointerException(
066: "Testing ability to throw System Exceptions");
067: }
068:
069: /**
070: * Maps to BasicStatelessObject.getPermissionsReport
071: *
072: * Returns a report of the bean's
073: * runtime permissions
074: *
075: * @return
076: * @see org.apache.openejb.test.stateless.BasicStatelessObject#getPermissionsReport
077: */
078: public Properties getPermissionsReport() {
079: /* TO DO: */
080: return null;
081: }
082:
083: /**
084: * Maps to BasicStatelessObject.getAllowedOperationsReport
085: *
086: * Returns a report of the allowed opperations
087: * for one of the bean's methods.
088: *
089: * @param methodName The method for which to get the allowed opperations report
090: * @return
091: * @see org.apache.openejb.test.stateless.BasicStatelessObject#getAllowedOperationsReport
092: */
093: public OperationsPolicy getAllowedOperationsReport(String methodName) {
094: return null;
095: }
096:
097: public void setSessionContext(SessionContext ctx)
098: throws EJBException, RemoteException {
099: }
100:
101: public Object remove() {
102: return "Executed remove() Method";
103: }
104:
105: public String remove(String arg) {
106: return arg;
107: }
108: }
|