PageRenderTime 55ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/src/com/sun/xml/internal/ws/policy/spi/PolicyAssertionCreator.java

https://gitlab.com/borneywpf/openjdk-7-src
Java | 87 lines | 9 code | 5 blank | 73 comment | 0 complexity | cc2e6e8d734ba881fa1c09c0a8383a0b MD5 | raw file
  1. /*
  2. * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  3. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4. *
  5. * This code is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 only, as
  7. * published by the Free Software Foundation. Oracle designates this
  8. * particular file as subject to the "Classpath" exception as provided
  9. * by Oracle in the LICENSE file that accompanied this code.
  10. *
  11. * This code is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. * version 2 for more details (a copy is included in the LICENSE file that
  15. * accompanied this code).
  16. *
  17. * You should have received a copy of the GNU General Public License version
  18. * 2 along with this work; if not, write to the Free Software Foundation,
  19. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22. * or visit www.oracle.com if you need additional information or have any
  23. * questions.
  24. */
  25. package com.sun.xml.internal.ws.policy.spi;
  26. import com.sun.xml.internal.ws.policy.AssertionSet;
  27. import com.sun.xml.internal.ws.policy.PolicyAssertion;
  28. import com.sun.xml.internal.ws.policy.sourcemodel.AssertionData;
  29. import java.util.Collection;
  30. /**
  31. * The interface defines contract for custom (domain specific) policy assertion
  32. * factories. The implementations are discovered using service provider mechanism
  33. * described in the
  34. * <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider">J2SE JAR File Specification</a>.
  35. *<p/>
  36. * Every implementation of policy assertion creator is expected to <b>fully</b>
  37. * handle the creation of assertions for the domain (namespace) it claims to
  38. * support by returning the namespace string from the {link #getSupportedDomainNamespaceUri()}
  39. * method. To handle creation of domain-specific assertions that are not intended
  40. * to be customized, the default policy assertion creator (passed as one of the
  41. * input parameters into the {@link #createAssertion(AssertionData, Collection, AssertionSet, PolicyAssertionCreator)} method)
  42. * shall be used.
  43. *
  44. * @author Marek Potociar
  45. */
  46. public interface PolicyAssertionCreator {
  47. /**
  48. * This method returns the namespace URIs of the domains that are supported by the implementation of
  49. * this inteface. There can be multiple URIs supported per single implementation.
  50. * <p/>
  51. * Supporting domain namespace URI means that particular {@code PolicyAssertionCreator} implementation
  52. * is able to create assertion instances for the domains identified by the namespace URIs returned from this
  53. * method. It is required that each {@code PolicyAssertionCreator} implementation handles the policy
  54. * assertion creation for <b>each</b> assertion in every domain it claims to support.
  55. *
  56. * @return string array representing the namespace URIs of the supported domains. It is expected that multiple calls on this method return the
  57. * same value each time. <b>Returned string array must be neither {@code null} nor empty. Also each string value in the array must not be {@code null}
  58. * nor empty.</b>
  59. *
  60. */
  61. String[] getSupportedDomainNamespaceURIs();
  62. /**
  63. * Creates domain-specific policy assertion instance according to assertion data provided. For the provided
  64. * assertion data and this policy assertion creator instance, it will allways be true that assertion namespace
  65. * URI equals to one of supported domain namespace URIs.
  66. *<p/>
  67. * Additional method parameter (which must not be {@code null}) supplied by the policy framework specifies a default policy
  68. * assertion creator that might be used to handle creation of unsupported domain assertion in the default way. This is
  69. * to give policy assertion creator a chance to handle also creation of "unsupported" domain assertions and to encourage
  70. * implemetors to use class composition instad of class inheritance.
  71. *
  72. * @param data assertion creation data specifying the details of newly created assertion
  73. * @param assertionParameters collection of assertions parameters of this policy assertion. May be {@code null}.
  74. * @param nestedAlternative assertion set specifying nested policy alternative. May be {@code null}.
  75. * @param defaultCreator default policy assertion creator implementation that shall be used to handle creation of assertions
  76. * which are not explicitly supported by this policy assertion creator implementation
  77. * @return domain specific policy assertion implementation according to assertion data provided.
  78. *
  79. * @throws AssertionCreationException in case of assertion creation failure
  80. */
  81. PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> assertionParameters, AssertionSet nestedAlternative, PolicyAssertionCreator defaultCreator) throws AssertionCreationException;
  82. }