1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.mirage.aop;
24  
25  import com.liferay.portal.kernel.annotation.BeanReference;
26  
27  import com.sun.portal.cms.mirage.service.custom.BinaryContentService;
28  import com.sun.portal.cms.mirage.service.custom.ContentFeedService;
29  import com.sun.portal.cms.mirage.service.custom.ContentService;
30  import com.sun.portal.cms.mirage.service.custom.ContentTypeService;
31  import com.sun.portal.cms.mirage.service.custom.WorkflowService;
32  
33  import org.aspectj.lang.ProceedingJoinPoint;
34  
35  /**
36   * <a href="BaseMirageAdvice.java.html"><b><i>View Source</i></b></a>
37   *
38   * @author Michael Young
39   *
40   */
41  public abstract class BaseMirageAdvice {
42  
43      public Object invoke(ProceedingJoinPoint proceedingJoinPoint)
44          throws Throwable {
45  
46          try {
47              return doInvoke(proceedingJoinPoint);
48          }
49          catch (Throwable t) {
50              Throwable cause = t.getCause();
51  
52              if (cause != null) {
53                  throw cause;
54              }
55              else {
56                  throw t;
57              }
58          }
59      }
60  
61      protected abstract Object doInvoke(ProceedingJoinPoint proceedingJoinPoint)
62          throws Throwable;
63  
64      @BeanReference(name = "com.liferay.portal.mirage.ArticleImageService")
65      protected BinaryContentService articleImageService;
66  
67      @BeanReference(name = "com.liferay.portal.mirage.ArticleResourceService")
68      protected BinaryContentService articleResourceService;
69  
70      @BeanReference(name = "com.liferay.portal.mirage.ContentFeedService")
71      protected ContentFeedService contentFeedService;
72  
73      @BeanReference(name = "com.liferay.portal.mirage.ContentSearchService")
74      protected BinaryContentService contentSearchService;
75  
76      @BeanReference(name = "com.liferay.portal.mirage.ContentService")
77      protected ContentService contentService;
78  
79      @BeanReference(name = "com.liferay.portal.mirage.ContentTypeService")
80      protected ContentTypeService contentTypeService;
81  
82      @BeanReference(name = "com.liferay.portal.mirage.WorkflowService")
83      protected WorkflowService workflowService;
84  
85  }