Skip to content

Commit

Permalink
Enable BELL properties with design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dazavala committed Jul 11, 2022
1 parent df62b24 commit 4c8c8c6
Show file tree
Hide file tree
Showing 26 changed files with 938 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ service.name.desc=The name of the service that the system will look up in the /M

# BETA
enableSpiVisibility.name=Enable SPI visibility
enableSpiVisibility.name.desc=Indicates whether or not the system makes feature SPI packages visible to the library referenced by the BELL. Enable SPI visibility whenever the BELL provides services that use feature SPI.
enableSpiVisibility.desc=Indicates whether or not the system makes feature SPI packages visible to the library referenced by the BELL. Enable SPI visibility whenever the BELL provides services that use feature SPI.

# BETA
properties.name=Properties
properties.desc=Name="Value" pairs the system will pass to a service implementation at creation and update. The service implementation class must declare a public constructor, or a public method named updateBell, with a single parameter of type java.util.Map<String, String>.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,31 @@
ibm:reference="com.ibm.ws.classloading.sharedlibrary"
/>
<AD id="library.target" type="String" required="true" default="(service.pid=${libraryRef})" name="internal" description="internal use only" ibm:final="true" />

<AD id="service" name="%service.name" description="%service.name.desc" required="false" type="String" cardinality="2147483647"/>
<AD id="enableSpiVisibility" name="%enableSpiVisibility.name" description="%enableSpiVisibility.name.desc" required="false" type="Boolean" default="false" ibm:beta="true"/>

<AD id="enableSpiVisibility" name="%enableSpiVisibility.name" description="%enableSpiVisibility.desc" required="false" type="Boolean" default="false" ibm:beta="true"/>

<AD id="properties" name="%properties.name" description="%properties.desc"
required="false"
type="String"
ibm:type="pid"
ibm:reference="com.ibm.ws.classloading.bell.properties"
ibm:flat="true"
ibm:beta="true" />

</OCD>

<Designate factoryPid="com.ibm.ws.classloading.bell">
<Object ocdref="com.ibm.ws.classloading.bell"/>
</Designate>

<OCD id="com.ibm.ws.classloading.bell.properties" name="%properties.name" description="%properties.desc" ibm:beta="true" ibm:alias="bellProperties">
<AD id="config.parentPID" type="String" required="false" name="internal" description="internal use only"/>
</OCD>

<Designate factoryPid="com.ibm.ws.classloading.bell.properties">
<Object ocdref="com.ibm.ws.classloading.bell.properties"/>
</Designate>

</metatype:MetaData>
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,11 @@ bell.spi.visibility.disabled.libref.global.useraction=Modify the BELL configurat
#bell.spi.visible.share.common.libref=CWWKL0061W: The {0} application and BELL share a common library reference, but do not reference the {1} library through a common class loader because the BELL is enabled for SPI visibility.
#bell.spi.visible.share.common.libref.explanation=To prevent applications and resources from seeing SPI packages, the BELL references the library through a unique class loader that is not shared with the application.
#bell.spi.visible.share.common.libref.useraction=Disable SPI visibility in the BELL configuration whenever the application and BELL must share a common library class loader. Otherwise, no action is required.

# BETA
# {0} - the name of the implementation class
# {1} - the location of the META-INF/services file, probably a URL that also indicates which jar it is in
# {2} - the name of the library
bell.missing.property.injection.methods=CWWKL0062W: The system cannot inject BELL properties into an instance of the {0} implementation class because the class is missing a public constructor or updateBell method having a single parameter of type java.util.Map<String,String>. The class is an implementation of the service that is declared in the {1} file and registered from the {2} library.
bell.missing.property.injection.methods.explanation=The system cannot access the public constructor or updateBell method it requires to inject BELL properties into the service implementation instance.
bell.missing.property.injection.methods.useraction=Ensure the class defines a public constructor or updateBell method having a single parameter of type java.util.Map<String, String>.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dev/com.ibm.ws.classloading.bells_fat/.classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="fat/src"/>
<classpathentry kind="src" path="test-applications/testProperties.jar/src"/>
<classpathentry kind="src" path="test-applications/SpiTypeVisibility.war/src"/>
<classpathentry kind="src" path="test-applications/testSpiTypeVisible.jar/src"/>
<classpathentry kind="src" path="test-applications/testSpiTypeVisible.jar/src"/>
<classpathentry kind="src" path="test-applications/testImplClassThrowsException.jar/src"/>
<classpathentry kind="src" path="test-applications/testMultipleValidServices.jar/src"/>
<classpathentry kind="src" path="test-applications/testMultipleImplsOfSingleService.jar/src"/>
Expand Down
3 changes: 2 additions & 1 deletion dev/com.ibm.ws.classloading.bells_fat/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ bVersion=1.0
-sub: *.bnd

src: \
fat/src,\
fat/src, \
test-applications/testProperties.jar/src, \
test-applications/SpiTypeVisibility.war/src, \
test-applications/testSpiTypeVisible.jar/src, \
test-applications/testImplClassNotConstructible.jar/src, \
Expand Down
Loading

0 comments on commit 4c8c8c6

Please sign in to comment.