Skip to content

Commit

Permalink
Remove JBI occurrences from source code
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Pinčuk <alexander.v.pinchuk@gmail.com>
  • Loading branch information
avpinchuk committed Sep 24, 2023
1 parent c795268 commit aa2d14b
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 452 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
* Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -30,9 +31,10 @@
import com.sun.ts.tests.common.vehicle.VehicleRunnerFactory;

/**
* This abstract class must be extended by all clients of tests of J2EE service apis; for example, JDBC, RMI-IIOP, JavaMail, JMS,
* etc. When a service test is encountered by the JavaTest Client, the instance is passed to a J2EE server component and run from
* that remote location. Using this model to develop tests allows the same test to be run from different locations within the
* This abstract class must be extended by all clients of tests of J2EE service apis; for example,
* JDBC, RMI-IIOP, JavaMail, JMS, etc. When a service test is encountered by the JavaTest Client,
* the instance is passed to a J2EE server component and run from that remote location. Using this
* model to develop tests allows the same test to be run from different locations within the
* scope of the J2EE Application Programming Model.
*
* @author Kyle Grucci
Expand All @@ -53,24 +55,24 @@ public abstract class ServiceEETest extends EETest {

private Object theSharedObject;

private Object theSharedObjectArray[];
private Object[] theSharedObjectArray;

/**
* Returns any additional properties that may need to be set by a subclass of ServiceEETest for use by a specific vehicle. This
* method was created due to a need for clients of the JBIVehicle to set the name of the object to lookup in the rmiregistry. By
* rule, this value should match the id name for the component specified in the JBI installation descriptor. This impl returns an
* empty properties object by default.
* Returns any additional properties that may need to be set by a subclass of ServiceEETest
* for use by a specific vehicle. This impl returns an empty properties object by default.
*
* @param p user configured properties used by the test
* @return Properties Additional properties that may need to be set by a subclass of ServiceEETest for use by a specific vehicle.
* @return Properties Additional properties that may need to be set by a subclass of ServiceEETest
* for use by a specific vehicle.
*/
public Properties getVehicleSpecificClientProps(Properties p) {
return new Properties();
}

/**
* When called within the harness VM, this method passes an instance of itself to the appropriate J2EE server component. When
* called from within that server component, EETest's run method is called and the test is run.
* When called within the harness VM, this method passes an instance of itself to the appropriate
* J2EE server component. When called from within that server component, EETest's run method is
* called and the test is run.
*
* @param argv an array of arguments that a test may use
* @param p user configured properties used by this test
Expand Down Expand Up @@ -117,7 +119,7 @@ protected Properties getTestPropsFromArgs(String[] argv) {
vLeftOverTestArgs = new Vector();

if (TestUtil.harnessDebug)
TestUtil.logHarnessDebug("ServiceEETest: " + argv.length + " args: " + Arrays.asList(argv).toString());
TestUtil.logHarnessDebug("ServiceEETest: " + argv.length + " args: " + Arrays.asList(argv));
// load a props object if used with -p
boolean tFound = false;
String argItem = null;
Expand All @@ -126,8 +128,8 @@ protected Properties getTestPropsFromArgs(String[] argv) {
if (argItem.equals("-p") || argItem.equals("-ap")) {
ap = initializeProperties(argv[++ii]);
// add additional props to "p"
Enumeration e = ap.propertyNames();
String key = null;
Enumeration<?> e = ap.propertyNames();
String key;
while (e.hasMoreElements()) {
key = (String) e.nextElement();
p.put(key, ap.getProperty(key));
Expand Down Expand Up @@ -184,12 +186,12 @@ public Status run(String[] argv, PrintWriter log, PrintWriter err) {
} else {
argv = new String[iSize];
for (int ii = 0; ii < iSize; ii++) {
argv[ii] = (String) vLeftOverTestArgs.elementAt(ii);
argv[ii] = vLeftOverTestArgs.elementAt(ii);
}
}
if (sTestCase == null)
if (sTestCase == null) {
return runAllTestCases(argv, props, log, err);
else {
} else {
for (int ii = 0; ii < sVehicles.length; ii++) {
props.put("vehicle", sVehicles[ii]);
// need to pass these streams to the Local Reporter
Expand All @@ -207,8 +209,7 @@ public Status run(String[] argv, PrintWriter log, PrintWriter err) {
return s;
}

// overridden to allow service tests to run in standalone
// mode outside of javatest
// Overridden to allow service tests to run in standalone mode outside of javatest
protected Status runAllTestCases(String[] argv, Properties p, PrintStream log, PrintStream err) {
if (sVehicles == null) {
if (TestUtil.harnessDebug)
Expand All @@ -234,10 +235,9 @@ private String[] getVehicles(Properties p) {
sVal = p.getProperty("service_eetest.vehicles");
} catch (Exception e) {
// got an exception looking up the prop, so set defaults
sVal = "";
sVal = "ejb servlet jsp";
}
if (sVal == null || sVal.equals("")) {
if (sVal == null || sVal.isEmpty()) {
sVehiclesToUse = "ejb servlet jsp";
if (TestUtil.harnessDebug)
TestUtil.logHarnessDebug("getVehicles: " + "Using default - all vehicles");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -17,157 +18,121 @@
package org.glassfish.webservices.config;

import com.sun.enterprise.config.serverbeans.ApplicationExtension;
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.Element;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;

import java.beans.PropertyVetoException;
import java.util.List;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.Element;

/**
* This specifies configuration for a web service end point. This web service
* end point could be JAXRPC or JSR-109 web service. It contains configuration
* about Monitoring, Transformation rules and Monitoring Log
* This specifies configuration for a web service endpoint.
*
* <p>This web service endpoint could be JAX-RPC or JSR-109 web service.
* It contains configuration about Monitoring, Transformation rules and Monitoring Log.
*/

/* @XmlType(name = "", propOrder = {
"registryLocation",
"transformationRule"
}) */

@Configured
public interface WebServiceEndpoint extends ApplicationExtension {

/**
* Gets the value of the name property.
* Gets the value of the {@code name} property.
*
* fully qualified web service name. Format:
* |ModuleName|#|EndpointName|, if the web service endpoint belongs to an
* application. (Parent of this element is j2ee-application).
* |EndpointName|, if the web service endpoint belongs to stand alone
* <p>Fully qualified web service name.
*
* <p>Format:
* <ul>
* <li><em>|ModuleName|#|EndpointName|</em> - if the web service endpoint belongs to an
* application. (Parent of this element is j2ee-application).</li>
* <li><em>|EndpointName|</em> - if the web service endpoint belongs to stand alone
* ejb-module or web-module (Parent of this element is either ejb-module
* or web-module).
* or web-module).</li>
* </ul>
*
* @return possible object is
* {@link String }
* @return possible object is {@link String}
*/
@Attribute(key=true)
@Attribute(key = true)
@NotNull
public String getName();
String getName();

/**
* Sets the value of the name property.
* Sets the value of the {@code name} property.
*
* @param value allowed object is
* {@link String }
* @param value allowed object is {@link String}
*/
public void setName(String value) throws PropertyVetoException;
void setName(String value) throws PropertyVetoException;

/**
* Gets the value of the monitoring property.
* Gets the value of the {@code monitoring} property.
*
* Monitoring level for this web service.
* <p>Monitoring level for this web service.
*
* @return possible object is
* {@link String }
* @return possible object is {@link String}
*/
@Attribute (defaultValue="OFF")
public String getMonitoring();
@Attribute(defaultValue = "OFF")
String getMonitoring();

/**
* Sets the value of the monitoring property.
* Sets the value of the {@code monitoring} property.
*
* @param value allowed object is
* {@link String }
* @param value allowed object is {@link String}
*/
public void setMonitoring(String value) throws PropertyVetoException;
void setMonitoring(String value) throws PropertyVetoException;

/**
* Gets the value of the maxHistorySize property.
* Gets the value of the {@code maxHistorySize} property.
*
* Maximum number of monitoring records stored in history for this end point
* <p>Maximum number of monitoring records stored in history for this end point.
*
* @return possible object is
* {@link String }
* @return possible object is {@link String}
*/
@Attribute (defaultValue="25")
@Attribute(defaultValue = "25")
@Min(value=1)
public String getMaxHistorySize();
String getMaxHistorySize();

/**
* Sets the value of the maxHistorySize property.
* Sets the value of the {@code maxHistorySize} property.
*
* @param value allowed object is
* {@link String }
* @param value allowed object is {@link String}
*/
public void setMaxHistorySize(String value) throws PropertyVetoException;
void setMaxHistorySize(String value) throws PropertyVetoException;

/**
* Gets the value of the jbiEnabled property.
* Gets the value of the {@code registryLocation} property.
*
* If true, it enables the visibility of this endoint as a service in JBI.
* <p>This accessor method returns a reference to the live list, not a snapshot.
* Therefore any modification you make to the returned list will be present inside
* the JAXB object. This is why there is not a {@code set} method for the
* {@code registryLocation} property.
*
* @return possible object is
* {@link String }
*/
@Attribute (defaultValue="false",dataType=Boolean.class)
public String getJbiEnabled();

/**
* Sets the value of the jbiEnabled property.
*
* @param value allowed object is
* {@link String }
*/
public void setJbiEnabled(String value) throws PropertyVetoException;

/**
* Gets the value of the registryLocation property.
* <p/>
* <p/>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the registryLocation property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
* <p>For example, to add a new item, do as follows:
* <pre>
* getRegistryLocation().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
* Objects of the following type(s) are allowed in the list
* {@link RegistryLocation }
*
* <p>Objects of the following type(s) are allowed in the list {@link RegistryLocation}
*/
@Element
public List<RegistryLocation> getRegistryLocation();
List<RegistryLocation> getRegistryLocation();

/**
* Gets the value of the transformationRule property.
* <p/>
* <p/>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the transformationRule property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
* Gets the value of the {@code transformationRule} property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot.
* Therefore any modification you make to the returned list will be present inside the JAXB object.
* This is why there is not a {@code set} method for the transformationRule property.
*
* <p>For example, to add a new item, do as follows:
* <pre>
* getTransformationRule().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
* Objects of the following type(s) are allowed in the list
* {@link TransformationRule }
*
* <p>Objects of the following type(s) are allowed in the list {@link TransformationRule}
*/
@Element
public List<TransformationRule> getTransformationRule();

List<TransformationRule> getTransformationRule();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -69,14 +70,6 @@ public final Pipe copy(PipeCloner cloner) {
}

public Packet process(Packet request) {
// if it is a JBI request then skip the monitoring logic. This is done
// as HTTPServletRequest/Response is not available when the invocation
// is from JavaEE service engine.

String delegateClassName = request.webServiceContextDelegate.getClass().getName();
if (delegateClassName.equals("com.sun.enterprise.jbi.serviceengine." + "bridge.transport.NMRServerConnection")) {
return next.process(request);
}

// No monitoring available for restful services
if ("http://www.w3.org/2004/08/wsdl/http".equals(endpoint.getProtocolBinding())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,26 +126,6 @@ delete-transformation-rule ?
list-transformation-rules ?
create-service L
login R
start-jbi-component
stop-jbi-component
shut-down-jbi-component
install-jbi-component
install-jbi-shared-library
list-jbi-shared-libraries
list-jbi-service-engines
list-jbi-binding-components
list-jbi-service-assemblies
deploy-jbi-service-assembly
undeploy-jbi-service-assembly
uninstall-jbi-component
uninstall-jbi-shared-library
start-jbi-service-assembly
stop-jbi-service-assembly
shut-down-jbi-service-assembly
show-jbi-service-assembly
show-jbi-service-engine
show-jbi-binding-component
show-jbi-shared-library
monitor R
create-system-properties R
delete-system-property R
Expand Down
Loading

0 comments on commit aa2d14b

Please sign in to comment.