congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Connector.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
org.eclipse.jetty.server.Connector

Best Java code snippets using org.eclipse.jetty.server.Connector.getName (Showing top 20 results out of 315)

origin: neo4j/neo4j

@Override
public String connector()
{
  return getConnector().getName();
}
origin: neo4j/neo4j

  private static Connector connectorMock( String name )
  {
    Connector connector = mock( Connector.class );
    when( connector.getName() ).thenReturn( name );
    when( connector.getExecutor() ).thenReturn( Runnable::run );
    when( connector.getServer() ).thenReturn( new Server() );
    return connector;
  }
}
origin: jphp-group/jphp

@Signature
public boolean unlisten(Environment env, String value) {
  if (server.isRunning()) {
    env.exception("Unable to unlisten() for running server");
  }
  String host = "0.0.0.0";
  String port = "80";
  if (value.contains(":")) {
    String[] strings = value.split("\\:");
    host = strings[0];
    if (strings.length > 1) {
      port = strings[1];
    }
  }
  for (Connector connector : server.getConnectors()) {
    if (connector.getName().equals(host + ":" + port)) {
      server.removeConnector(connector);
      return true;
    }
  }
  return false;
}
origin: jphp-group/jphp

@Signature
public Memory connectors() {
  Connector[] connectors = server.getConnectors();
  ArrayMemory arrayMemory = ArrayMemory.createListed(connectors.length);
  for (Connector connector : connectors) {
    arrayMemory.add(connector.getName());
  }
  return arrayMemory.toImmutable();
}
origin: neo4j/neo4j

  private JettyHttpConnection createConnection( Connector connector, EndPoint endPoint )
  {
    String connectionId = connectionTracker.newConnectionId( connector.getName() );
    return new JettyHttpConnection( connectionId, getHttpConfiguration(), connector, endPoint,
        getHttpCompliance(), isRecordHttpComplianceViolations() );
  }
}
origin: org.apache.kafka/connect-runtime

ServerConnector findConnector(String protocol) {
  for (Connector connector : jettyServer.getConnectors()) {
    if (connector.getName().startsWith(protocol))
      return (ServerConnector) connector;
  }
  return null;
}
origin: org.neo4j.app/neo4j-server

@Override
public String connector()
{
  return getConnector().getName();
}
origin: com.azaptree/azaptree-http-service

@Override
@ManagedAttribute
public String getName() {
  return server.getConnectors()[0].getName();
}
origin: org.apache.activemq/activemq-osgi

public URI bind() throws Exception {
  URI bind = getBindLocation();
  String bindHost = bind.getHost();
  bindHost = (bindHost == null || bindHost.length() == 0) ? "localhost" : bindHost;
  InetAddress addr = InetAddress.getByName(bindHost);
  host = addr.getCanonicalHostName();
  if (server.getConnectors().length == 0) {
    LOG.info("Creating Jetty connector");
    setConnectorProperty("Host", String.class, host);
    setConnectorProperty("Port", Integer.TYPE, bindAddress.getPort());
    server.addConnector(connector);
  } else {
    LOG.info("Using Jetty configured connector");
    connector = server.getConnectors()[0];
    for (Connector c : server.getConnectors()) {
      if (c.getName() != null && c.getName().equalsIgnoreCase("activemq")) {
        connector = c;
      }
    }
    setConnectorProperty("Host", String.class, host);
    setConnectorProperty("Port", Integer.TYPE, bindAddress.getPort());
    server.addConnector(connector);
  }
  if (addr.isAnyLocalAddress()) {
    host = InetAddressUtil.getLocalHostName();
  }
  URI boundUri = new URI(bind.getScheme(), bind.getUserInfo(), host, bindAddress.getPort(), bind.getPath(), bind.getQuery(), bind.getFragment());
  setConnectURI(boundUri);
  return boundUri;
}
origin: org.eclipse.jetty.aggregate/jetty-all-server

private void dumpUrl()
{
  Connector[] connectors = getServer().getConnectors();
  for (int i=0;i<connectors.length;i++)
  {
    String connectorName = connectors[i].getName();
    String displayName = getDisplayName();
    if (displayName == null)
      displayName = "WebApp@"+connectors.hashCode();
    LOG.info(displayName + " at http://" + connectorName + getContextPath());
  }
}
origin: org.apache.activemq/activemq-all

public URI bind() throws Exception {
  URI bind = getBindLocation();
  String bindHost = bind.getHost();
  bindHost = (bindHost == null || bindHost.length() == 0) ? "localhost" : bindHost;
  InetAddress addr = InetAddress.getByName(bindHost);
  host = addr.getCanonicalHostName();
  if (server.getConnectors().length == 0) {
    LOG.info("Creating Jetty connector");
    setConnectorProperty("Host", String.class, host);
    setConnectorProperty("Port", Integer.TYPE, bindAddress.getPort());
    server.addConnector(connector);
  } else {
    LOG.info("Using Jetty configured connector");
    connector = server.getConnectors()[0];
    for (Connector c : server.getConnectors()) {
      if (c.getName() != null && c.getName().equalsIgnoreCase("activemq")) {
        connector = c;
      }
    }
    setConnectorProperty("Host", String.class, host);
    setConnectorProperty("Port", Integer.TYPE, bindAddress.getPort());
    server.addConnector(connector);
  }
  if (addr.isAnyLocalAddress()) {
    host = InetAddressUtil.getLocalHostName();
  }
  URI boundUri = new URI(bind.getScheme(), bind.getUserInfo(), host, bindAddress.getPort(), bind.getPath(), bind.getQuery(), bind.getFragment());
  setConnectURI(boundUri);
  return boundUri;
}
origin: org.apache.activemq/activemq-http

public URI bind() throws Exception {
  URI bind = getBindLocation();
  String bindHost = bind.getHost();
  bindHost = (bindHost == null || bindHost.length() == 0) ? "localhost" : bindHost;
  InetAddress addr = InetAddress.getByName(bindHost);
  host = addr.getCanonicalHostName();
  if (server.getConnectors().length == 0) {
    LOG.info("Creating Jetty connector");
    setConnectorProperty("Host", String.class, host);
    setConnectorProperty("Port", Integer.TYPE, bindAddress.getPort());
    server.addConnector(connector);
  } else {
    LOG.info("Using Jetty configured connector");
    connector = server.getConnectors()[0];
    for (Connector c : server.getConnectors()) {
      if (c.getName() != null && c.getName().equalsIgnoreCase("activemq")) {
        connector = c;
      }
    }
    setConnectorProperty("Host", String.class, host);
    setConnectorProperty("Port", Integer.TYPE, bindAddress.getPort());
    server.addConnector(connector);
  }
  if (addr.isAnyLocalAddress()) {
    host = InetAddressUtil.getLocalHostName();
  }
  URI boundUri = new URI(bind.getScheme(), bind.getUserInfo(), host, bindAddress.getPort(), bind.getPath(), bind.getQuery(), bind.getFragment());
  setConnectURI(boundUri);
  return boundUri;
}
origin: org.eclipse.jetty.aggregate/jetty-webapp

private void dumpUrl()
{
  Connector[] connectors = getServer().getConnectors();
  for (int i=0;i<connectors.length;i++)
  {
    String connectorName = connectors[i].getName();
    String displayName = getDisplayName();
    if (displayName == null)
      displayName = "WebApp@"+connectors.hashCode();
    LOG.info(displayName + " at http://" + connectorName + getContextPath());
  }
}
origin: org.eclipse.jetty.aggregate/jetty-plus

private void dumpUrl()
{
  Connector[] connectors = getServer().getConnectors();
  for (int i=0;i<connectors.length;i++)
  {
    String connectorName = connectors[i].getName();
    String displayName = getDisplayName();
    if (displayName == null)
      displayName = "WebApp@"+connectors.hashCode();
    LOG.info(displayName + " at http://" + connectorName + getContextPath());
  }
}
origin: org.eclipse.jetty.aggregate/jetty-webapp

for (Connector connector : _connectors)
  sb.append("<h3>").append(connector.getName()).append("</h3>");
origin: org.eclipse.jetty.aggregate/jetty-all-server

for (Connector connector : _connectors)
  sb.append("<h3>").append(connector.getName()).append("</h3>");
origin: HuygensING/timbuctoo

 @Override
 public void serverStarted(Server server) {
  // Detect the port Jetty is listening on - works with configured and random ports
  for (final Connector connector : server.getConnectors()) {
   try {
    if ("application".equals(connector.getName())) {
     final ServerSocketChannel channel = (ServerSocketChannel) connector
      .getTransport();
     final InetSocketAddress socket = (InetSocketAddress) channel
      .getLocalAddress();
     timbuctooConfiguration.getUriHelper().notifyOfPort(socket.getPort());
    }
   } catch (Exception e) {
    LOG.error("No base url provided, and unable to get generate one myself", e);
   }
  }
 }
}
origin: Nextdoor/bender

case '@':
  connectorName=true;
  String name=baseRequest.getHttpChannel().getConnector().getName();
  boolean m=name!=null && contextVhost.length()==name.length()+1 && contextVhost.endsWith(name);
  match = match || m;
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

case '@':
  connectorName=true;
  String name=baseRequest.getHttpChannel().getConnector().getName();
  boolean m=name!=null && contextVhost.length()==name.length()+1 && contextVhost.endsWith(name);
  match = match || m;
origin: org.neo4j.app/neo4j-server

  private JettyHttpConnection createConnection( Connector connector, EndPoint endPoint )
  {
    String connectionId = connectionTracker.newConnectionId( connector.getName() );
    return new JettyHttpConnection( connectionId, getHttpConfiguration(), connector, endPoint,
        getHttpCompliance(), isRecordHttpComplianceViolations() );
  }
}
org.eclipse.jetty.serverConnectorgetName

Javadoc

Get the connector name if set.

A ContextHandler may be configured with virtual hosts in the form "@connectorName" and will only serve requests from the named connector.

Popular methods of Connector

  • setPort
  • stop
  • getLocalPort
  • start
  • getServer
  • setHost
    Set the hostname of the interface to bind to.
  • getConnectionFactories
  • getPort
  • getConnectionFactory
  • getExecutor
  • getHost
  • getByteBufferPool
  • getHost,
  • getByteBufferPool,
  • close,
  • getProtocols,
  • getScheduler,
  • isConfidential,
  • isIntegral,
  • shutdown,
  • getDefaultConnectionFactory

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JCheckBox (javax.swing)
  • JPanel (javax.swing)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now