View Javadoc
1   package org.andromda.cartridges.ejb.metafacades;
2   
3   import org.andromda.cartridges.ejb.EJBGlobals;
4   import org.andromda.cartridges.ejb.EJBProfile;
5   import org.apache.commons.lang.StringUtils;
6   
7   /**
8    * MetafacadeLogic implementation for org.andromda.cartridges.ejb.metafacades.EJBOperationFacade.
9    *
10   * @see org.andromda.cartridges.ejb.metafacades.EJBOperationFacade
11   */
12  public class EJBOperationFacadeLogicImpl
13          extends EJBOperationFacadeLogic
14  {
15      private static final long serialVersionUID = 34L;
16      // ---------------- constructor -------------------------------
17  
18      /**
19       * @param metaObject
20       * @param context
21       */
22      public EJBOperationFacadeLogicImpl(Object metaObject, String context)
23      {
24          super(metaObject, context);
25      }
26  
27      /**
28       * @see org.andromda.cartridges.ejb.metafacades.EJBOperationFacadeLogic#handleGetTransactionType()
29       * @see org.andromda.cartridges.ejb.metafacades.EJBOperationFacade#getTransactionType()
30       */
31      protected String handleGetTransactionType()
32      {
33          String transactionType = (String)this.findTaggedValue(EJBProfile.TAGGEDVALUE_EJB_TRANSACTION_TYPE, true);
34          if (StringUtils.isBlank(transactionType))
35          {
36              transactionType = String.valueOf(this.getConfiguredProperty(EJBGlobals.TRANSACTION_TYPE));
37          }
38          if (StringUtils.isBlank(transactionType))
39          {
40              transactionType = "Required";
41          }
42          return transactionType;
43      }
44  
45      /**
46       * @see org.andromda.cartridges.ejb.metafacades.EJBOperationFacadeLogic#handleIsBusinessOperation()
47       * @see org.andromda.cartridges.ejb.metafacades.EJBOperationFacade#isBusinessOperation()
48       */
49      protected boolean handleIsBusinessOperation()
50      {
51          return !this.hasStereotype(EJBProfile.STEREOTYPE_CREATE_METHOD) &&
52                  !this.hasStereotype(EJBProfile.STEREOTYPE_FINDER_METHOD) &&
53                  !this.hasStereotype(EJBProfile.STEREOTYPE_SELECT_METHOD);
54      }
55  
56      /**
57       * @see org.andromda.cartridges.ejb.metafacades.EJBOperationFacadeLogic#handleIsSelectMethod()
58       * @see org.andromda.cartridges.ejb.metafacades.EJBOperationFacade#isSelectMethod()
59       */
60      protected boolean handleIsSelectMethod()
61      {
62          return this.hasStereotype(EJBProfile.STEREOTYPE_SELECT_METHOD);
63      }
64  }