Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Adding unification of the port types #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

t-mazgalov
Copy link

The JAXRSConnector checks if the ports of the HTTP Service implementation and the registered resource are equal. In some cases, the value of HTTP Service port is Integer and the check fails.

I'm using the Equinox HTTP Service implementation which registers

{org.osgi.service.http.HttpService}={http.port=80, service.pid=org.eclipse.equinox.http.HttpService-http, http.address=ALL, service.vendor=IBM, service.description=OSGi Http Service - IBM Implementation, http.scheme=http, http.timeout=30, service.id=106, service.bundleid=91, service.scope=bundle}

  private HttpService findHttpServiceForPort( Object port ) {
    ServiceHolder[] serviceHolders = httpServices.getServices();
    HttpService result = null;
    for( ServiceHolder serviceHolder : serviceHolders ) {
      Object servicePort = getPort( serviceHolder );
      // servicePort is Integer
      // port is String
      if( servicePort.equals( port ) ) {
        result = ( HttpService )serviceHolder.getService();
      }
    }
    return result;
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant