01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.ejb;
23:
24: // $Id: AllowedOperationsFlags.java 57209 2006-09-26 12:21:57Z dimitris@jboss.org $
25:
26: /**
27: * Constants used by the AllowedOperationsAssociation
28: *
29: * According to the EJB2.1 spec not all context methods can be accessed at all times
30: * For example ctx.getPrimaryKey() should throw an IllegalStateException when called from within ejbCreate()
31: *
32: * @author Thomas.Diesler@jboss.org
33: * @version $Revision: 57209 $
34: */
35: public interface AllowedOperationsFlags {
36: // Constants -----------------------------------------------------
37:
38: /**
39: * These constants are used to validate method access
40: */
41: public static final int NOT_ALLOWED = 0;
42: public static final int IN_INTERCEPTOR_METHOD = (int) Math
43: .pow(2, 0);
44: public static final int IN_EJB_ACTIVATE = (int) Math.pow(2, 1);
45: public static final int IN_EJB_PASSIVATE = (int) Math.pow(2, 2);
46: public static final int IN_EJB_REMOVE = (int) Math.pow(2, 3);
47: public static final int IN_EJB_CREATE = (int) Math.pow(2, 4);
48: public static final int IN_EJB_POST_CREATE = (int) Math.pow(2, 5);
49: public static final int IN_EJB_FIND = (int) Math.pow(2, 6);
50: public static final int IN_EJB_HOME = (int) Math.pow(2, 7);
51: public static final int IN_EJB_TIMEOUT = (int) Math.pow(2, 8);
52: public static final int IN_EJB_LOAD = (int) Math.pow(2, 9);
53: public static final int IN_EJB_STORE = (int) Math.pow(2, 10);
54: public static final int IN_SET_ENTITY_CONTEXT = (int) Math.pow(2,
55: 11);
56: public static final int IN_UNSET_ENTITY_CONTEXT = (int) Math.pow(2,
57: 12);
58: public static final int IN_SET_SESSION_CONTEXT = (int) Math.pow(2,
59: 13);
60: public static final int IN_SET_MESSAGE_DRIVEN_CONTEXT = (int) Math
61: .pow(2, 14);
62: public static final int IN_AFTER_BEGIN = (int) Math.pow(2, 15);
63: public static final int IN_BEFORE_COMPLETION = (int) Math
64: .pow(2, 16);
65: public static final int IN_AFTER_COMPLETION = (int) Math.pow(2, 17);
66: public static final int IN_BUSINESS_METHOD = (int) Math.pow(2, 18);
67: public static final int IN_SERVICE_ENDPOINT_METHOD = (int) Math
68: .pow(2, 19);
69: }
|