PageRenderTime 35ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/jboss-as-7.1.1.Final/jacorb/src/main/java/org/jboss/as/jacorb/JacORBExtension.java

#
Java | 69 lines | 31 code | 10 blank | 28 comment | 0 complexity | 808f98cedd1d2ca480798f7153d94e5f MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright 2011, 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.jacorb;
  23. import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIBE;
  24. import org.jboss.as.controller.Extension;
  25. import org.jboss.as.controller.ExtensionContext;
  26. import org.jboss.as.controller.SubsystemRegistration;
  27. import org.jboss.as.controller.descriptions.ResourceDescriptionResolver;
  28. import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver;
  29. import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler;
  30. import org.jboss.as.controller.parsing.ExtensionParsingContext;
  31. import org.jboss.as.controller.registry.ManagementResourceRegistration;
  32. import org.jboss.as.controller.registry.OperationEntry;
  33. /**
  34. * <p>
  35. * The JacORB extension implementation.
  36. * </p>
  37. *
  38. * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
  39. */
  40. public class JacORBExtension implements Extension {
  41. private static final JacORBSubsystemParser PARSER = JacORBSubsystemParser.INSTANCE;
  42. public static final String SUBSYSTEM_NAME = "jacorb";
  43. private static final String RESOURCE_NAME = JacORBExtension.class.getPackage().getName() + ".LocalDescriptions";
  44. static ResourceDescriptionResolver getResourceDescriptionResolver(final String keyPrefix) {
  45. return new StandardResourceDescriptionResolver(keyPrefix, RESOURCE_NAME, JacORBExtension.class.getClassLoader(), true, false);
  46. }
  47. @Override
  48. public void initialize(ExtensionContext context) {
  49. final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0);
  50. final ManagementResourceRegistration subsystemRegistration = subsystem.registerSubsystemModel(JacORBSubsystemResource.INSTANCE);
  51. subsystemRegistration.registerOperationHandler(DESCRIBE, GenericSubsystemDescribeHandler.INSTANCE, GenericSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE);
  52. subsystem.registerXMLElementWriter(PARSER);
  53. }
  54. @Override
  55. public void initializeParsers(ExtensionParsingContext context) {
  56. context.setSubsystemXmlMapping(SUBSYSTEM_NAME, JacORBSubsystemParser.Namespace.JacORB_1_0.getUriString(), PARSER);
  57. context.setSubsystemXmlMapping(SUBSYSTEM_NAME, JacORBSubsystemParser.Namespace.JacORB_1_1.getUriString(), PARSER);
  58. }
  59. }