PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/jboss-as-7.1.1.Final/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java

#
Java | 68 lines | 32 code | 6 blank | 30 comment | 2 complexity | e04f1910c095582f986854b67dba64ce MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright (c) 2012, Red Hat, Inc., and individual contributors
  4. * as indicated by the @author tags. See the copyright.txt file in the
  5. * distribution for a full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * 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.as.ejb3.deployment.processors;
  23. import org.jboss.as.server.deployment.DeploymentUnit;
  24. import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
  25. import org.jboss.as.server.deployment.DeploymentUnitProcessor;
  26. import org.jboss.as.server.deployment.annotation.CompositeIndex;
  27. import org.jboss.logging.Logger;
  28. import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
  29. /**
  30. * Make sure we process annotations first and then start on the descriptors.
  31. *
  32. * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
  33. */
  34. public class AnnotatedEJBComponentDescriptionDeploymentUnitProcessor extends AbstractDeploymentUnitProcessor implements DeploymentUnitProcessor {
  35. private static final Logger logger = Logger.getLogger(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.class);
  36. private final EJBComponentDescriptionFactory[] factories;
  37. /**
  38. * If this is an appclient we want to make the components as not installable, so we can still look up which EJB's are in
  39. * the deployment, but do not actually install them
  40. */
  41. protected final boolean appclient;
  42. public AnnotatedEJBComponentDescriptionDeploymentUnitProcessor(final boolean appclient) {
  43. super(appclient);
  44. this.appclient = appclient;
  45. this.factories = new EJBComponentDescriptionFactory[] {
  46. new MessageDrivenComponentDescriptionFactory(appclient),
  47. new SessionBeanComponentDescriptionFactory(appclient)
  48. };
  49. }
  50. @Override
  51. protected void processAnnotations(final DeploymentUnit deploymentUnit, final CompositeIndex compositeIndex) throws DeploymentUnitProcessingException {
  52. for (final EJBComponentDescriptionFactory factory : factories) {
  53. factory.processAnnotations(deploymentUnit, compositeIndex);
  54. }
  55. }
  56. @Override
  57. protected void processBeanMetaData(final DeploymentUnit deploymentUnit, final EnterpriseBeanMetaData ejb) throws DeploymentUnitProcessingException {
  58. for (final EJBComponentDescriptionFactory factory : factories) {
  59. factory.processBeanMetaData(deploymentUnit, ejb);
  60. }
  61. }
  62. }