id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
105,400 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/bootstrap/ConnectionlessBootstrap.java | ConnectionlessBootstrap.bindAsync | public ChannelFuture bindAsync(final SocketAddress localAddress) {
if (localAddress == null) {
throw new NullPointerException("localAddress");
}
ChannelPipeline pipeline;
try {
pipeline = getPipelineFactory().getPipeline();
} catch (Exception e) {
... | java | public ChannelFuture bindAsync(final SocketAddress localAddress) {
if (localAddress == null) {
throw new NullPointerException("localAddress");
}
ChannelPipeline pipeline;
try {
pipeline = getPipelineFactory().getPipeline();
} catch (Exception e) {
... | [
"public",
"ChannelFuture",
"bindAsync",
"(",
"final",
"SocketAddress",
"localAddress",
")",
"{",
"if",
"(",
"localAddress",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"localAddress\"",
")",
";",
"}",
"ChannelPipeline",
"pipeline",
";",
... | Creates a new channel which is bound to the specified local address.
@return a new {@link ChannelFuture} which will be notified once the Channel is
bound and accepts incoming connections
@throws ChannelException
if failed to create a new channel and
bind it to the local address | [
"Creates",
"a",
"new",
"channel",
"which",
"is",
"bound",
"to",
"the",
"specified",
"local",
"address",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/bootstrap/ConnectionlessBootstrap.java#L81-L110 |
105,401 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/impl/GatewayImpl.java | GatewayImpl.setProperties | @Override
public void setProperties(Properties properties) {
if (this.env == null) {
this.env = properties;
} else {
this.env.putAll(properties);
}
if (baseGateway != null) {
baseGateway.setProperties(properties);
}
} | java | @Override
public void setProperties(Properties properties) {
if (this.env == null) {
this.env = properties;
} else {
this.env.putAll(properties);
}
if (baseGateway != null) {
baseGateway.setProperties(properties);
}
} | [
"@",
"Override",
"public",
"void",
"setProperties",
"(",
"Properties",
"properties",
")",
"{",
"if",
"(",
"this",
".",
"env",
"==",
"null",
")",
"{",
"this",
".",
"env",
"=",
"properties",
";",
"}",
"else",
"{",
"this",
".",
"env",
".",
"putAll",
"("... | Configure a new Gateway instance with the given environment properties. | [
"Configure",
"a",
"new",
"Gateway",
"instance",
"with",
"the",
"given",
"environment",
"properties",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/impl/GatewayImpl.java#L100-L111 |
105,402 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/util/version/ManifestReader.java | ManifestReader.getManifestAttributesFromURL | public Attributes getManifestAttributesFromURL(URL url) throws IOException {
Manifest manifest = new Manifest(url.openStream());
return manifest.getMainAttributes();
} | java | public Attributes getManifestAttributesFromURL(URL url) throws IOException {
Manifest manifest = new Manifest(url.openStream());
return manifest.getMainAttributes();
} | [
"public",
"Attributes",
"getManifestAttributesFromURL",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"Manifest",
"manifest",
"=",
"new",
"Manifest",
"(",
"url",
".",
"openStream",
"(",
")",
")",
";",
"return",
"manifest",
".",
"getMainAttributes",
"(",
... | Retrieves the jar file manifest attributes for a given class path entry
@param url - the class path entry
@return the manifest file attributes
@throws IOException | [
"Retrieves",
"the",
"jar",
"file",
"manifest",
"attributes",
"for",
"a",
"given",
"class",
"path",
"entry"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/util/version/ManifestReader.java#L44-L47 |
105,403 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoConnector.java | AbstractPollingIoConnector.processConnections | private int processConnections(Iterator<H> handlers) {
int nHandles = 0;
// Loop on each connection request
while (handlers.hasNext()) {
H handle = handlers.next();
handlers.remove();
ConnectionRequest connectionRequest = getConnectionRequest(handle)... | java | private int processConnections(Iterator<H> handlers) {
int nHandles = 0;
// Loop on each connection request
while (handlers.hasNext()) {
H handle = handlers.next();
handlers.remove();
ConnectionRequest connectionRequest = getConnectionRequest(handle)... | [
"private",
"int",
"processConnections",
"(",
"Iterator",
"<",
"H",
">",
"handlers",
")",
"{",
"int",
"nHandles",
"=",
"0",
";",
"// Loop on each connection request",
"while",
"(",
"handlers",
".",
"hasNext",
"(",
")",
")",
"{",
"H",
"handle",
"=",
"handlers"... | Process the incoming connections, creating a new session for each
valid connection. | [
"Process",
"the",
"incoming",
"connections",
"creating",
"a",
"new",
"session",
"for",
"each",
"valid",
"connection",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoConnector.java#L414-L448 |
105,404 | kaazing/gateway | transport/wseb/src/main/java/org/kaazing/gateway/transport/wseb/WsebSession.java | WsebSession.checkLongPollingOrder | private boolean checkLongPollingOrder(HttpAcceptSession session) {
if (firstWriter && !validateSequenceNo && longpoll(session)) {
String message = "Out of order long-polling request, must not be first";
setCloseException(new IOException(message));
HttpStatus status = HttpStat... | java | private boolean checkLongPollingOrder(HttpAcceptSession session) {
if (firstWriter && !validateSequenceNo && longpoll(session)) {
String message = "Out of order long-polling request, must not be first";
setCloseException(new IOException(message));
HttpStatus status = HttpStat... | [
"private",
"boolean",
"checkLongPollingOrder",
"(",
"HttpAcceptSession",
"session",
")",
"{",
"if",
"(",
"firstWriter",
"&&",
"!",
"validateSequenceNo",
"&&",
"longpoll",
"(",
"session",
")",
")",
"{",
"String",
"message",
"=",
"\"Out of order long-polling request, mu... | If the first write request is long-polling, then it is out of order | [
"If",
"the",
"first",
"write",
"request",
"is",
"long",
"-",
"polling",
"then",
"it",
"is",
"out",
"of",
"order"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/wseb/src/main/java/org/kaazing/gateway/transport/wseb/WsebSession.java#L763-L774 |
105,405 | kaazing/gateway | service/proxy/src/main/java/org/kaazing/gateway/service/proxy/ConnectionPool.java | ConnectionPool.addConnectFuture | private void addConnectFuture(ConnectFuture future) {
Object key = connectFutures.add(future);
future.getSession().setAttributeIfAbsent(CONNECT_FUTURE_KEY, key);
} | java | private void addConnectFuture(ConnectFuture future) {
Object key = connectFutures.add(future);
future.getSession().setAttributeIfAbsent(CONNECT_FUTURE_KEY, key);
} | [
"private",
"void",
"addConnectFuture",
"(",
"ConnectFuture",
"future",
")",
"{",
"Object",
"key",
"=",
"connectFutures",
".",
"add",
"(",
"future",
")",
";",
"future",
".",
"getSession",
"(",
")",
".",
"setAttributeIfAbsent",
"(",
"CONNECT_FUTURE_KEY",
",",
"k... | the associated ConnectFuture from the map of preconnect futures. | [
"the",
"associated",
"ConnectFuture",
"from",
"the",
"map",
"of",
"preconnect",
"futures",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/proxy/src/main/java/org/kaazing/gateway/service/proxy/ConnectionPool.java#L136-L139 |
105,406 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/SocksProxyRequest.java | SocksProxyRequest.getPort | public byte[] getPort() {
byte[] port = new byte[2];
int p = (getEndpointAddress() == null ? this.port
: getEndpointAddress().getPort());
port[1] = (byte) p;
port[0] = (byte) (p >> 8);
return port;
} | java | public byte[] getPort() {
byte[] port = new byte[2];
int p = (getEndpointAddress() == null ? this.port
: getEndpointAddress().getPort());
port[1] = (byte) p;
port[0] = (byte) (p >> 8);
return port;
} | [
"public",
"byte",
"[",
"]",
"getPort",
"(",
")",
"{",
"byte",
"[",
"]",
"port",
"=",
"new",
"byte",
"[",
"2",
"]",
";",
"int",
"p",
"=",
"(",
"getEndpointAddress",
"(",
")",
"==",
"null",
"?",
"this",
".",
"port",
":",
"getEndpointAddress",
"(",
... | Return the server port as a byte array.
@return the server port | [
"Return",
"the",
"server",
"port",
"as",
"a",
"byte",
"array",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/SocksProxyRequest.java#L118-L125 |
105,407 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/SocksProxyRequest.java | SocksProxyRequest.getHost | public synchronized final String getHost() {
if (host == null) {
InetSocketAddress adr = getEndpointAddress();
if ( adr != null && !adr.isUnresolved()) {
host = getEndpointAddress().getHostName();
}
}
return host;
} | java | public synchronized final String getHost() {
if (host == null) {
InetSocketAddress adr = getEndpointAddress();
if ( adr != null && !adr.isUnresolved()) {
host = getEndpointAddress().getHostName();
}
}
return host;
} | [
"public",
"synchronized",
"final",
"String",
"getHost",
"(",
")",
"{",
"if",
"(",
"host",
"==",
"null",
")",
"{",
"InetSocketAddress",
"adr",
"=",
"getEndpointAddress",
"(",
")",
";",
"if",
"(",
"adr",
"!=",
"null",
"&&",
"!",
"adr",
".",
"isUnresolved",... | Return the server host name.
@return the server host name | [
"Return",
"the",
"server",
"host",
"name",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/SocksProxyRequest.java#L159-L169 |
105,408 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/extension/WebSocketExtensionFactory.java | WebSocketExtensionFactory.offerWebSocketExtensions | public List<WebSocketExtension> offerWebSocketExtensions(WsResourceAddress address,
ExtensionHelper extensionHelper) {
List<WebSocketExtension> list = new ArrayList<>();
for(WebSocketExtensionFactorySpi factory : factoriesRO.values()) {
... | java | public List<WebSocketExtension> offerWebSocketExtensions(WsResourceAddress address,
ExtensionHelper extensionHelper) {
List<WebSocketExtension> list = new ArrayList<>();
for(WebSocketExtensionFactorySpi factory : factoriesRO.values()) {
... | [
"public",
"List",
"<",
"WebSocketExtension",
">",
"offerWebSocketExtensions",
"(",
"WsResourceAddress",
"address",
",",
"ExtensionHelper",
"extensionHelper",
")",
"{",
"List",
"<",
"WebSocketExtension",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"f... | Returns a list of extensions that want to be part of websocket request
@param address WsResourceAddress to which a websocket connection is being attempted
@param extensionHelper extension helper
@return list of extensions that want to be part of the request | [
"Returns",
"a",
"list",
"of",
"extensions",
"that",
"want",
"to",
"be",
"part",
"of",
"websocket",
"request"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/extension/WebSocketExtensionFactory.java#L113-L124 |
105,409 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java | GatewayContextResolver.resolveServiceDefaults | private DefaultServiceDefaultsContext resolveServiceDefaults(ServiceDefaultsType serviceDefaults, RealmsContext realmsContext) {
if (serviceDefaults == null) {
return null;
}
DefaultAcceptOptionsContext acceptOptions = null;
ServiceAcceptOptionsType serviceAcceptOptions = ... | java | private DefaultServiceDefaultsContext resolveServiceDefaults(ServiceDefaultsType serviceDefaults, RealmsContext realmsContext) {
if (serviceDefaults == null) {
return null;
}
DefaultAcceptOptionsContext acceptOptions = null;
ServiceAcceptOptionsType serviceAcceptOptions = ... | [
"private",
"DefaultServiceDefaultsContext",
"resolveServiceDefaults",
"(",
"ServiceDefaultsType",
"serviceDefaults",
",",
"RealmsContext",
"realmsContext",
")",
"{",
"if",
"(",
"serviceDefaults",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"DefaultAcceptOptionsCon... | own object to management. | [
"own",
"object",
"to",
"management",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java#L416-L446 |
105,410 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java | GatewayContextResolver.supportsConnects | private boolean supportsConnects(String serviceType) {
return !serviceType.equals("jms") &&
!serviceType.equals("echo") &&
!serviceType.equals("management.jmx") &&
!serviceType.equals("$management.jmx$") &&
!serviceType.equals("management.snmp") &&... | java | private boolean supportsConnects(String serviceType) {
return !serviceType.equals("jms") &&
!serviceType.equals("echo") &&
!serviceType.equals("management.jmx") &&
!serviceType.equals("$management.jmx$") &&
!serviceType.equals("management.snmp") &&... | [
"private",
"boolean",
"supportsConnects",
"(",
"String",
"serviceType",
")",
"{",
"return",
"!",
"serviceType",
".",
"equals",
"(",
"\"jms\"",
")",
"&&",
"!",
"serviceType",
".",
"equals",
"(",
"\"echo\"",
")",
"&&",
"!",
"serviceType",
".",
"equals",
"(",
... | Gross method to tell us if a given service type supports using 'connect's. XXX This needs to be fixed later!
@param serviceType
@return | [
"Gross",
"method",
"to",
"tell",
"us",
"if",
"a",
"given",
"service",
"type",
"supports",
"using",
"connect",
"s",
".",
"XXX",
"This",
"needs",
"to",
"be",
"fixed",
"later!"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/context/resolve/GatewayContextResolver.java#L1221-L1229 |
105,411 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpMergeRequestFilter.java | HttpMergeRequestFilter.removeFilter | protected final void removeFilter(IoFilterChain filterChain, IoFilter filter) {
if (filterChain.contains(filter)) {
filterChain.remove(filter);
}
} | java | protected final void removeFilter(IoFilterChain filterChain, IoFilter filter) {
if (filterChain.contains(filter)) {
filterChain.remove(filter);
}
} | [
"protected",
"final",
"void",
"removeFilter",
"(",
"IoFilterChain",
"filterChain",
",",
"IoFilter",
"filter",
")",
"{",
"if",
"(",
"filterChain",
".",
"contains",
"(",
"filter",
")",
")",
"{",
"filterChain",
".",
"remove",
"(",
"filter",
")",
";",
"}",
"}"... | A utility method to remove a filter from a filter chain, without
complaining if it is not in the chain.
@param filterChain the filter chain
@param filter the filter to remove | [
"A",
"utility",
"method",
"to",
"remove",
"a",
"filter",
"from",
"a",
"filter",
"chain",
"without",
"complaining",
"if",
"it",
"is",
"not",
"in",
"the",
"chain",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpMergeRequestFilter.java#L397-L401 |
105,412 | kaazing/gateway | transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/bridge/filter/SslFilter.java | SslFilter.sessionClosed | @Override
public void sessionClosed(NextFilter nextFilter, IoSession session)
throws SSLException {
SslHandler handler = getSslSessionHandler(session);
try {
synchronized (handler) {
// release resources
handler.destroy();
}
... | java | @Override
public void sessionClosed(NextFilter nextFilter, IoSession session)
throws SSLException {
SslHandler handler = getSslSessionHandler(session);
try {
synchronized (handler) {
// release resources
handler.destroy();
}
... | [
"@",
"Override",
"public",
"void",
"sessionClosed",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
")",
"throws",
"SSLException",
"{",
"SslHandler",
"handler",
"=",
"getSslSessionHandler",
"(",
"session",
")",
";",
"try",
"{",
"synchronized",
"(",
... | IoFilter impl. | [
"IoFilter",
"impl",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ssl/src/main/java/org/kaazing/gateway/transport/ssl/bridge/filter/SslFilter.java#L389-L404 |
105,413 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/future/DefaultIoFuture.java | DefaultIoFuture.await0 | private boolean await0(long timeoutMillis, boolean interruptable) throws InterruptedException {
long endTime = System.currentTimeMillis() + timeoutMillis;
if (endTime < 0) {
endTime = Long.MAX_VALUE;
}
synchronized (lock) {
if (ready) {
r... | java | private boolean await0(long timeoutMillis, boolean interruptable) throws InterruptedException {
long endTime = System.currentTimeMillis() + timeoutMillis;
if (endTime < 0) {
endTime = Long.MAX_VALUE;
}
synchronized (lock) {
if (ready) {
r... | [
"private",
"boolean",
"await0",
"(",
"long",
"timeoutMillis",
",",
"boolean",
"interruptable",
")",
"throws",
"InterruptedException",
"{",
"long",
"endTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"timeoutMillis",
";",
"if",
"(",
"endTime",
"<",... | Wait for the Future to be ready. If the requested delay is 0 or
negative, this method immediately returns the value of the
'ready' flag.
Every 5 second, the wait will be suspended to be able to check if
there is a deadlock or not.
@param timeoutMillis The delay we will wait for the Future to be ready
@param interrupta... | [
"Wait",
"for",
"the",
"Future",
"to",
"be",
"ready",
".",
"If",
"the",
"requested",
"delay",
"is",
"0",
"or",
"negative",
"this",
"method",
"immediately",
"returns",
"the",
"value",
"of",
"the",
"ready",
"flag",
".",
"Every",
"5",
"second",
"the",
"wait"... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/future/DefaultIoFuture.java#L165-L207 |
105,414 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/future/DefaultIoFuture.java | DefaultIoFuture.setValue | public void setValue(Object newValue) {
synchronized (lock) {
// Allow only once.
if (ready) {
return;
}
result = newValue;
ready = true;
if (waiters > 0) {
lock.notifyAll();
}
}
... | java | public void setValue(Object newValue) {
synchronized (lock) {
// Allow only once.
if (ready) {
return;
}
result = newValue;
ready = true;
if (waiters > 0) {
lock.notifyAll();
}
}
... | [
"public",
"void",
"setValue",
"(",
"Object",
"newValue",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"// Allow only once.",
"if",
"(",
"ready",
")",
"{",
"return",
";",
"}",
"result",
"=",
"newValue",
";",
"ready",
"=",
"true",
";",
"if",
"(",
"wa... | Sets the result of the asynchronous operation, and mark it as finished. | [
"Sets",
"the",
"result",
"of",
"the",
"asynchronous",
"operation",
"and",
"mark",
"it",
"as",
"finished",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/future/DefaultIoFuture.java#L272-L287 |
105,415 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java | SslHandler.destroy | public void destroy() {
if (sslEngine == null) {
return;
}
// Close inbound and flush all remaining data if available.
try {
sslEngine.closeInbound();
} catch (SSLException e) {
LOGGER.debug(
"Unexpected exception from SSLE... | java | public void destroy() {
if (sslEngine == null) {
return;
}
// Close inbound and flush all remaining data if available.
try {
sslEngine.closeInbound();
} catch (SSLException e) {
LOGGER.debug(
"Unexpected exception from SSLE... | [
"public",
"void",
"destroy",
"(",
")",
"{",
"if",
"(",
"sslEngine",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// Close inbound and flush all remaining data if available.",
"try",
"{",
"sslEngine",
".",
"closeInbound",
"(",
")",
";",
"}",
"catch",
"(",
"SSLE... | Release allocated buffers. | [
"Release",
"allocated",
"buffers",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java#L157-L190 |
105,416 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java | SslHandler.closeOutbound | public boolean closeOutbound() throws SSLException {
if (sslEngine == null || sslEngine.isOutboundDone()) {
return false;
}
sslEngine.closeOutbound();
createOutNetBuffer(0);
SSLEngineResult result;
for (;;) {
result = sslEngine.wrap(emptyBuffer.b... | java | public boolean closeOutbound() throws SSLException {
if (sslEngine == null || sslEngine.isOutboundDone()) {
return false;
}
sslEngine.closeOutbound();
createOutNetBuffer(0);
SSLEngineResult result;
for (;;) {
result = sslEngine.wrap(emptyBuffer.b... | [
"public",
"boolean",
"closeOutbound",
"(",
")",
"throws",
"SSLException",
"{",
"if",
"(",
"sslEngine",
"==",
"null",
"||",
"sslEngine",
".",
"isOutboundDone",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"sslEngine",
".",
"closeOutbound",
"(",
")",
";"... | Start SSL shutdown process.
@return <tt>true</tt> if shutdown process is started.
<tt>false</tt> if shutdown process is already finished.
@throws SSLException on errors | [
"Start",
"SSL",
"shutdown",
"process",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java#L382-L406 |
105,417 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResolutionUtils.java | ResolutionUtils.getAllByName | public static Collection<InetAddress> getAllByName(String host, boolean allowIPv6) {
Enumeration<NetworkInterface> networkInterfaces = cloneInterfaces(ResolutionUtils.networkInterfaces);
List<String> resolvedAddresses = resolveDeviceAddress(host, networkInterfaces, allowIPv6);
List<InetAddress> res... | java | public static Collection<InetAddress> getAllByName(String host, boolean allowIPv6) {
Enumeration<NetworkInterface> networkInterfaces = cloneInterfaces(ResolutionUtils.networkInterfaces);
List<String> resolvedAddresses = resolveDeviceAddress(host, networkInterfaces, allowIPv6);
List<InetAddress> res... | [
"public",
"static",
"Collection",
"<",
"InetAddress",
">",
"getAllByName",
"(",
"String",
"host",
",",
"boolean",
"allowIPv6",
")",
"{",
"Enumeration",
"<",
"NetworkInterface",
">",
"networkInterfaces",
"=",
"cloneInterfaces",
"(",
"ResolutionUtils",
".",
"networkIn... | Method resolving host to InetAddresses
@param host
@return | [
"Method",
"resolving",
"host",
"to",
"InetAddresses"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResolutionUtils.java#L67-L80 |
105,418 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResolutionUtils.java | ResolutionUtils.parseBindAddress | public static InetSocketAddress parseBindAddress(String bindAddress) {
Exception cause = null;
try {
if (!bindAddress.contains(":")) {
// port only
return new InetSocketAddress(Integer.parseInt(bindAddress));
}
// Test for network inter... | java | public static InetSocketAddress parseBindAddress(String bindAddress) {
Exception cause = null;
try {
if (!bindAddress.contains(":")) {
// port only
return new InetSocketAddress(Integer.parseInt(bindAddress));
}
// Test for network inter... | [
"public",
"static",
"InetSocketAddress",
"parseBindAddress",
"(",
"String",
"bindAddress",
")",
"{",
"Exception",
"cause",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"!",
"bindAddress",
".",
"contains",
"(",
"\":\"",
")",
")",
"{",
"// port only",
"return",
"n... | Method creating an InetAddress from String.
@param bindAddress syntax host:port
host optional, can be specified as IPv4, IPv6, NetworkInterface
port mandatory
@return | [
"Method",
"creating",
"an",
"InetAddress",
"from",
"String",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResolutionUtils.java#L89-L116 |
105,419 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResolutionUtils.java | ResolutionUtils.resolveDeviceAddress | private static List<String> resolveDeviceAddress(String deviceName,
Enumeration<NetworkInterface> networkInterfaces, boolean allowIPv6) {
List<String> resolvedAddresses = new ArrayList<>();
if (deviceName.startsWith("[@") && deviceName.endsWith("]")) {
deviceName = deviceName.subs... | java | private static List<String> resolveDeviceAddress(String deviceName,
Enumeration<NetworkInterface> networkInterfaces, boolean allowIPv6) {
List<String> resolvedAddresses = new ArrayList<>();
if (deviceName.startsWith("[@") && deviceName.endsWith("]")) {
deviceName = deviceName.subs... | [
"private",
"static",
"List",
"<",
"String",
">",
"resolveDeviceAddress",
"(",
"String",
"deviceName",
",",
"Enumeration",
"<",
"NetworkInterface",
">",
"networkInterfaces",
",",
"boolean",
"allowIPv6",
")",
"{",
"List",
"<",
"String",
">",
"resolvedAddresses",
"="... | Method performing device address resolution
@param deviceName
@param networkInterfaces
@param allowIPv6
@return | [
"Method",
"performing",
"device",
"address",
"resolution"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResolutionUtils.java#L125-L160 |
105,420 | kaazing/gateway | transport/wseb/src/main/java/org/kaazing/gateway/transport/wseb/filter/WsebFrameEscapeZeroAndNewLineEncoder.java | WsebFrameEscapeZeroAndNewLineEncoder.calculatePrefixBytes | protected ByteBuffer calculatePrefixBytes(int payloadLength, byte opCode) {
int totalOffset = 2 + WsUtils.calculateEncodedLengthSize(payloadLength);
ByteBuffer binary = ByteBuffer.allocate(totalOffset);
binary.put(opCode);
WsUtils.encodeLength(binary, payloadLength);
//the on... | java | protected ByteBuffer calculatePrefixBytes(int payloadLength, byte opCode) {
int totalOffset = 2 + WsUtils.calculateEncodedLengthSize(payloadLength);
ByteBuffer binary = ByteBuffer.allocate(totalOffset);
binary.put(opCode);
WsUtils.encodeLength(binary, payloadLength);
//the on... | [
"protected",
"ByteBuffer",
"calculatePrefixBytes",
"(",
"int",
"payloadLength",
",",
"byte",
"opCode",
")",
"{",
"int",
"totalOffset",
"=",
"2",
"+",
"WsUtils",
".",
"calculateEncodedLengthSize",
"(",
"payloadLength",
")",
";",
"ByteBuffer",
"binary",
"=",
"ByteBu... | quick calculate WsebFrame prefix bytes | [
"quick",
"calculate",
"WsebFrame",
"prefix",
"bytes"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/wseb/src/main/java/org/kaazing/gateway/transport/wseb/filter/WsebFrameEscapeZeroAndNewLineEncoder.java#L166-L198 |
105,421 | kaazing/gateway | transport/wseb/src/main/java/org/kaazing/gateway/transport/wseb/filter/WsebFrameEscapeZeroAndNewLineEncoder.java | WsebFrameEscapeZeroAndNewLineEncoder.doEscapeZeroAndNewline | private byte[] doEscapeZeroAndNewline(byte[] decodedArray,int decodedArrayOffset, int decodedArrayPosition,int decodedArrayLimit, byte[] encodedArray, int[] encodedArrayInsertionCount, ByteBuffer prefix) {
int prefixLength = prefix.remaining();
for (; decodedArrayPosition < decodedArrayLimit; decodedArr... | java | private byte[] doEscapeZeroAndNewline(byte[] decodedArray,int decodedArrayOffset, int decodedArrayPosition,int decodedArrayLimit, byte[] encodedArray, int[] encodedArrayInsertionCount, ByteBuffer prefix) {
int prefixLength = prefix.remaining();
for (; decodedArrayPosition < decodedArrayLimit; decodedArr... | [
"private",
"byte",
"[",
"]",
"doEscapeZeroAndNewline",
"(",
"byte",
"[",
"]",
"decodedArray",
",",
"int",
"decodedArrayOffset",
",",
"int",
"decodedArrayPosition",
",",
"int",
"decodedArrayLimit",
",",
"byte",
"[",
"]",
"encodedArray",
",",
"int",
"[",
"]",
"e... | insert escape characters into encodedArray, return number of inserted bytes | [
"insert",
"escape",
"characters",
"into",
"encodedArray",
"return",
"number",
"of",
"inserted",
"bytes"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/wseb/src/main/java/org/kaazing/gateway/transport/wseb/filter/WsebFrameEscapeZeroAndNewLineEncoder.java#L201-L265 |
105,422 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/util/SessionAttributeInitializingFilter.java | SessionAttributeInitializingFilter.setAttributes | public void setAttributes(Map<String, ?> attributes) {
if (attributes == null) {
attributes = new HashMap<>();
}
this.attributes.clear();
this.attributes.putAll(attributes);
} | java | public void setAttributes(Map<String, ?> attributes) {
if (attributes == null) {
attributes = new HashMap<>();
}
this.attributes.clear();
this.attributes.putAll(attributes);
} | [
"public",
"void",
"setAttributes",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"attributes",
")",
"{",
"if",
"(",
"attributes",
"==",
"null",
")",
"{",
"attributes",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"this",
".",
"attributes",
".",
"clea... | Sets the attribute map. The specified attributes are copied into the
underlying map, so modifying the specified attributes parameter after
the call won't change the internal state. | [
"Sets",
"the",
"attribute",
"map",
".",
"The",
"specified",
"attributes",
"are",
"copied",
"into",
"the",
"underlying",
"map",
"so",
"modifying",
"the",
"specified",
"attributes",
"parameter",
"after",
"the",
"call",
"won",
"t",
"change",
"the",
"internal",
"s... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/util/SessionAttributeInitializingFilter.java#L125-L132 |
105,423 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/util/SessionAttributeInitializingFilter.java | SessionAttributeInitializingFilter.sessionCreated | @Override
public void sessionCreated(NextFilter nextFilter, IoSession session)
throws Exception {
for (Map.Entry<String, Object> e : attributes.entrySet()) {
session.setAttribute(e.getKey(), e.getValue());
}
nextFilter.sessionCreated(session);
} | java | @Override
public void sessionCreated(NextFilter nextFilter, IoSession session)
throws Exception {
for (Map.Entry<String, Object> e : attributes.entrySet()) {
session.setAttribute(e.getKey(), e.getValue());
}
nextFilter.sessionCreated(session);
} | [
"@",
"Override",
"public",
"void",
"sessionCreated",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"e",
":",
"attributes",
".",
"entrySet",
... | Puts all pre-configured attributes into the actual session attribute
map and forward the event to the next filter. | [
"Puts",
"all",
"pre",
"-",
"configured",
"attributes",
"into",
"the",
"actual",
"session",
"attribute",
"map",
"and",
"forward",
"the",
"event",
"to",
"the",
"next",
"filter",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/util/SessionAttributeInitializingFilter.java#L138-L146 |
105,424 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/statistic/ProfilerTimerFilter.java | ProfilerTimerFilter.getTotalTime | public long getTotalTime(IoEventType type) {
switch (type) {
case MESSAGE_RECEIVED :
if (profileMessageReceived) {
return messageReceivedTimerWorker.getTotal();
}
break;
case MESSAGE_SEN... | java | public long getTotalTime(IoEventType type) {
switch (type) {
case MESSAGE_RECEIVED :
if (profileMessageReceived) {
return messageReceivedTimerWorker.getTotal();
}
break;
case MESSAGE_SEN... | [
"public",
"long",
"getTotalTime",
"(",
"IoEventType",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"MESSAGE_RECEIVED",
":",
"if",
"(",
"profileMessageReceived",
")",
"{",
"return",
"messageReceivedTimerWorker",
".",
"getTotal",
"(",
")",
";",
"}"... | The total time this method has been executing
@param type
The {@link IoEventType} that the user wants to get the total time this method has
been executing
@return
The total time for the method represented by the {@link IoEventType} | [
"The",
"total",
"time",
"this",
"method",
"has",
"been",
"executing"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/statistic/ProfilerTimerFilter.java#L602-L649 |
105,425 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java | AbstractProxyLogicHandler.writeData | protected WriteFuture writeData(final NextFilter nextFilter,
final IoBuffer data) {
// write net data
ProxyHandshakeIoBuffer writeBuffer = new ProxyHandshakeIoBuffer(data);
LOGGER.debug(" session write: {}", writeBuffer);
WriteFuture writeFuture = new DefaultWriteFuture(g... | java | protected WriteFuture writeData(final NextFilter nextFilter,
final IoBuffer data) {
// write net data
ProxyHandshakeIoBuffer writeBuffer = new ProxyHandshakeIoBuffer(data);
LOGGER.debug(" session write: {}", writeBuffer);
WriteFuture writeFuture = new DefaultWriteFuture(g... | [
"protected",
"WriteFuture",
"writeData",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"IoBuffer",
"data",
")",
"{",
"// write net data",
"ProxyHandshakeIoBuffer",
"writeBuffer",
"=",
"new",
"ProxyHandshakeIoBuffer",
"(",
"data",
")",
";",
"LOGGER",
".",
"... | Writes data to the proxy server.
@param nextFilter the next filter
@param data Data buffer to be written. | [
"Writes",
"data",
"to",
"the",
"proxy",
"server",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java#L99-L111 |
105,426 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java | AbstractProxyLogicHandler.setHandshakeComplete | protected final void setHandshakeComplete() {
synchronized (this) {
handshakeComplete = true;
}
ProxyIoSession proxyIoSession = getProxyIoSession();
proxyIoSession.getConnector()
.fireConnected(proxyIoSession.getSession())
.awaitUninterruptibl... | java | protected final void setHandshakeComplete() {
synchronized (this) {
handshakeComplete = true;
}
ProxyIoSession proxyIoSession = getProxyIoSession();
proxyIoSession.getConnector()
.fireConnected(proxyIoSession.getSession())
.awaitUninterruptibl... | [
"protected",
"final",
"void",
"setHandshakeComplete",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"handshakeComplete",
"=",
"true",
";",
"}",
"ProxyIoSession",
"proxyIoSession",
"=",
"getProxyIoSession",
"(",
")",
";",
"proxyIoSession",
".",
"getConnecto... | Signals that the handshake has finished. | [
"Signals",
"that",
"the",
"handshake",
"has",
"finished",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java#L126-L145 |
105,427 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java | AbstractProxyLogicHandler.flushPendingWriteRequests | protected synchronized void flushPendingWriteRequests() throws Exception {
LOGGER.debug(" flushPendingWriteRequests()");
if (writeRequestQueue == null) {
return;
}
Event scheduledWrite;
while ((scheduledWrite = writeRequestQueue.poll()) != null) {
LOGGER... | java | protected synchronized void flushPendingWriteRequests() throws Exception {
LOGGER.debug(" flushPendingWriteRequests()");
if (writeRequestQueue == null) {
return;
}
Event scheduledWrite;
while ((scheduledWrite = writeRequestQueue.poll()) != null) {
LOGGER... | [
"protected",
"synchronized",
"void",
"flushPendingWriteRequests",
"(",
")",
"throws",
"Exception",
"{",
"LOGGER",
".",
"debug",
"(",
"\" flushPendingWriteRequests()\"",
")",
";",
"if",
"(",
"writeRequestQueue",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Event",
... | Send any write requests which were queued whilst waiting for handshaking to complete. | [
"Send",
"any",
"write",
"requests",
"which",
"were",
"queued",
"whilst",
"waiting",
"for",
"handshaking",
"to",
"complete",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java#L150-L168 |
105,428 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java | AbstractProxyLogicHandler.enqueueWriteRequest | public synchronized void enqueueWriteRequest(final NextFilter nextFilter,
final WriteRequest writeRequest) {
if (writeRequestQueue == null) {
writeRequestQueue = new LinkedList<>();
}
writeRequestQueue.offer(new Event(nextFilter, writeRequest));
} | java | public synchronized void enqueueWriteRequest(final NextFilter nextFilter,
final WriteRequest writeRequest) {
if (writeRequestQueue == null) {
writeRequestQueue = new LinkedList<>();
}
writeRequestQueue.offer(new Event(nextFilter, writeRequest));
} | [
"public",
"synchronized",
"void",
"enqueueWriteRequest",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"WriteRequest",
"writeRequest",
")",
"{",
"if",
"(",
"writeRequestQueue",
"==",
"null",
")",
"{",
"writeRequestQueue",
"=",
"new",
"LinkedList",
"<>",
... | Enqueue a message to be written once handshaking is complete. | [
"Enqueue",
"a",
"message",
"to",
"be",
"written",
"once",
"handshaking",
"is",
"complete",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/AbstractProxyLogicHandler.java#L173-L180 |
105,429 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpSubjectSecurityFilter.java | HttpSubjectSecurityFilter.doMessageReceived | @Override
public void doMessageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception {
// GL.debug("http", getClass().getSimpleName() + " request received.");
if (! httpRequestMessageReceived(nextFilter, session, message)) return;
HttpRequestMessage httpReques... | java | @Override
public void doMessageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception {
// GL.debug("http", getClass().getSimpleName() + " request received.");
if (! httpRequestMessageReceived(nextFilter, session, message)) return;
HttpRequestMessage httpReques... | [
"@",
"Override",
"public",
"void",
"doMessageReceived",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"// GL.debug(\"http\", getClass().getSimpleName() + \" request received.\");",
"if",
"(",
"!",
... | Security code for subject-security LEGACY | [
"Security",
"code",
"for",
"subject",
"-",
"security",
"LEGACY"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpSubjectSecurityFilter.java#L96-L134 |
105,430 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpSubjectSecurityFilter.java | HttpSubjectSecurityFilter.securityMessageReceived | void securityMessageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception {
final boolean loggerIsEnabled = logger != null && logger.isTraceEnabled();
if (! httpRequestMessageReceived(nextFilter, session, message)) return;
HttpRequestMessage httpRequest = (HttpReq... | java | void securityMessageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception {
final boolean loggerIsEnabled = logger != null && logger.isTraceEnabled();
if (! httpRequestMessageReceived(nextFilter, session, message)) return;
HttpRequestMessage httpRequest = (HttpReq... | [
"void",
"securityMessageReceived",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"final",
"boolean",
"loggerIsEnabled",
"=",
"logger",
"!=",
"null",
"&&",
"logger",
".",
"isTraceEnabled",
"... | Security code for subject-security going forward | [
"Security",
"code",
"for",
"subject",
"-",
"security",
"going",
"forward"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpSubjectSecurityFilter.java#L313-L385 |
105,431 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java | AbstractHttpLogicHandler.writeRequest0 | private void writeRequest0(final NextFilter nextFilter,
final HttpProxyRequest request) {
try {
String data = request.toHttpString();
IoBuffer buf = IoBuffer.wrap(data.getBytes(getProxyIoSession()
.getCharsetName()));
LOGGER.debug(" write:\n... | java | private void writeRequest0(final NextFilter nextFilter,
final HttpProxyRequest request) {
try {
String data = request.toHttpString();
IoBuffer buf = IoBuffer.wrap(data.getBytes(getProxyIoSession()
.getCharsetName()));
LOGGER.debug(" write:\n... | [
"private",
"void",
"writeRequest0",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"HttpProxyRequest",
"request",
")",
"{",
"try",
"{",
"String",
"data",
"=",
"request",
".",
"toHttpString",
"(",
")",
";",
"IoBuffer",
"buf",
"=",
"IoBuffer",
".",
"w... | Encodes a HTTP request and sends it to the proxy server.
@param nextFilter the next filter
@param request the http request | [
"Encodes",
"a",
"HTTP",
"request",
"and",
"sends",
"it",
"to",
"the",
"proxy",
"server",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java#L326-L341 |
105,432 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java | AbstractHttpLogicHandler.reconnect | private void reconnect(final NextFilter nextFilter,
final HttpProxyRequest request) {
LOGGER.debug("Reconnecting to proxy ...");
final ProxyIoSession proxyIoSession = getProxyIoSession();
// Fires reconnection
proxyIoSession.getConnector().connect(
new IoSes... | java | private void reconnect(final NextFilter nextFilter,
final HttpProxyRequest request) {
LOGGER.debug("Reconnecting to proxy ...");
final ProxyIoSession proxyIoSession = getProxyIoSession();
// Fires reconnection
proxyIoSession.getConnector().connect(
new IoSes... | [
"private",
"void",
"reconnect",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"HttpProxyRequest",
"request",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Reconnecting to proxy ...\"",
")",
";",
"final",
"ProxyIoSession",
"proxyIoSession",
"=",
"getProxyIoSessio... | Method to reconnect to the proxy when it decides not to maintain the connection
during handshake.
@param nextFilter the next filter
@param request the http request | [
"Method",
"to",
"reconnect",
"to",
"the",
"proxy",
"when",
"it",
"decides",
"not",
"to",
"maintain",
"the",
"connection",
"during",
"handshake",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java#L350-L379 |
105,433 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java | AbstractHttpLogicHandler.decodeResponse | protected HttpProxyResponse decodeResponse(final String response)
throws Exception {
LOGGER.debug(" parseResponse()");
// Break response into lines
String[] responseLines = response.split(HttpProxyConstants.CRLF);
// Status-Line = HTTP-Version SP Status-Code SP Reason-Phra... | java | protected HttpProxyResponse decodeResponse(final String response)
throws Exception {
LOGGER.debug(" parseResponse()");
// Break response into lines
String[] responseLines = response.split(HttpProxyConstants.CRLF);
// Status-Line = HTTP-Version SP Status-Code SP Reason-Phra... | [
"protected",
"HttpProxyResponse",
"decodeResponse",
"(",
"final",
"String",
"response",
")",
"throws",
"Exception",
"{",
"LOGGER",
".",
"debug",
"(",
"\" parseResponse()\"",
")",
";",
"// Break response into lines",
"String",
"[",
"]",
"responseLines",
"=",
"response... | Parse a HTTP response from the proxy server.
@param response The response string. | [
"Parse",
"a",
"HTTP",
"response",
"from",
"the",
"proxy",
"server",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractHttpLogicHandler.java#L386-L417 |
105,434 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/Utils.java | Utils.assertIOThread | public static void assertIOThread(Thread t, boolean flag) {
if (flag) {
assert t.equals(Thread.currentThread()) : "Management NOT on IO thread when expected"; // XXX testing
} else {
assert !(t.equals(Thread.currentThread())) : "Management on IO thread when not expected"; // XX... | java | public static void assertIOThread(Thread t, boolean flag) {
if (flag) {
assert t.equals(Thread.currentThread()) : "Management NOT on IO thread when expected"; // XXX testing
} else {
assert !(t.equals(Thread.currentThread())) : "Management on IO thread when not expected"; // XX... | [
"public",
"static",
"void",
"assertIOThread",
"(",
"Thread",
"t",
",",
"boolean",
"flag",
")",
"{",
"if",
"(",
"flag",
")",
"{",
"assert",
"t",
".",
"equals",
"(",
"Thread",
".",
"currentThread",
"(",
")",
")",
":",
"\"Management NOT on IO thread when expect... | means we expect that we are NOT. | [
"means",
"we",
"expect",
"that",
"we",
"are",
"NOT",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/Utils.java#L101-L107 |
105,435 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/Utils.java | Utils.sumFutures | public static long sumFutures(List<Future<Object>> futures) {
long total = 0;
for (Future<Object> f : futures) {
try {
total += (Long) f.get();
} catch (Exception ignore) {
System.out.println("### sumFutures got exception!");
}
... | java | public static long sumFutures(List<Future<Object>> futures) {
long total = 0;
for (Future<Object> f : futures) {
try {
total += (Long) f.get();
} catch (Exception ignore) {
System.out.println("### sumFutures got exception!");
}
... | [
"public",
"static",
"long",
"sumFutures",
"(",
"List",
"<",
"Future",
"<",
"Object",
">",
">",
"futures",
")",
"{",
"long",
"total",
"=",
"0",
";",
"for",
"(",
"Future",
"<",
"Object",
">",
"f",
":",
"futures",
")",
"{",
"try",
"{",
"total",
"+=",
... | This must NOT run on any IO worker thread | [
"This",
"must",
"NOT",
"run",
"on",
"any",
"IO",
"worker",
"thread"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/Utils.java#L117-L129 |
105,436 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/Utils.java | Utils.makeJSONArrayString | public static String makeJSONArrayString(Object[] values) {
// Since they won't change during a run, compute the JSON value for the
// summary data fields (an array where all field names are wrapped in quotes
StringBuilder buf = new StringBuilder();
int numVals = values.length;
... | java | public static String makeJSONArrayString(Object[] values) {
// Since they won't change during a run, compute the JSON value for the
// summary data fields (an array where all field names are wrapped in quotes
StringBuilder buf = new StringBuilder();
int numVals = values.length;
... | [
"public",
"static",
"String",
"makeJSONArrayString",
"(",
"Object",
"[",
"]",
"values",
")",
"{",
"// Since they won't change during a run, compute the JSON value for the",
"// summary data fields (an array where all field names are wrapped in quotes",
"StringBuilder",
"buf",
"=",
"n... | Given an array of strings, return a string that equals the output of creating a JSONArray and then stringifying it.
@param values
@return | [
"Given",
"an",
"array",
"of",
"strings",
"return",
"a",
"string",
"that",
"equals",
"the",
"output",
"of",
"creating",
"a",
"JSONArray",
"and",
"then",
"stringifying",
"it",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/Utils.java#L147-L165 |
105,437 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeWriter.java | CompositeByteArrayRelativeWriter.flushTo | public void flushTo( int index )
{
ByteArray removed = cba.removeTo( index );
flusher.flush( removed );
} | java | public void flushTo( int index )
{
ByteArray removed = cba.removeTo( index );
flusher.flush( removed );
} | [
"public",
"void",
"flushTo",
"(",
"int",
"index",
")",
"{",
"ByteArray",
"removed",
"=",
"cba",
".",
"removeTo",
"(",
"index",
")",
";",
"flusher",
".",
"flush",
"(",
"removed",
")",
";",
"}"
] | Flush to the given index. | [
"Flush",
"to",
"the",
"given",
"index",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/byteaccess/CompositeByteArrayRelativeWriter.java#L165-L169 |
105,438 | kaazing/gateway | mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioWorker.java | AbstractNioWorker.messageReceived | public void messageReceived(AbstractNioChannel<?> channel, ChannelEvent event) {
boolean written = readQueue.offer(event);
if (!written) {
noDroppedMessages++;
if (noDroppedMessages%10000 == 0) {
if (LOGGER.isInfoEnabled()) {
String msg = "UDP ... | java | public void messageReceived(AbstractNioChannel<?> channel, ChannelEvent event) {
boolean written = readQueue.offer(event);
if (!written) {
noDroppedMessages++;
if (noDroppedMessages%10000 == 0) {
if (LOGGER.isInfoEnabled()) {
String msg = "UDP ... | [
"public",
"void",
"messageReceived",
"(",
"AbstractNioChannel",
"<",
"?",
">",
"channel",
",",
"ChannelEvent",
"event",
")",
"{",
"boolean",
"written",
"=",
"readQueue",
".",
"offer",
"(",
"event",
")",
";",
"if",
"(",
"!",
"written",
")",
"{",
"noDroppedM... | This method is called from the boss thread | [
"This",
"method",
"is",
"called",
"from",
"the",
"boss",
"thread"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioWorker.java#L649-L668 |
105,439 | kaazing/gateway | service/update.check/src/main/java/org/kaazing/gateway/service/update/check/GatewayVersion.java | GatewayVersion.parseGatewayVersion | public static GatewayVersion parseGatewayVersion(String version) throws Exception {
if ("develop-SNAPSHOT".equals(version)) {
return new GatewayVersion(0, 0, 0);
} else {
String regex = "(?<major>[0-9]+)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+)-?(?<rc>[RC0-9{3}]*)";
Patt... | java | public static GatewayVersion parseGatewayVersion(String version) throws Exception {
if ("develop-SNAPSHOT".equals(version)) {
return new GatewayVersion(0, 0, 0);
} else {
String regex = "(?<major>[0-9]+)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+)-?(?<rc>[RC0-9{3}]*)";
Patt... | [
"public",
"static",
"GatewayVersion",
"parseGatewayVersion",
"(",
"String",
"version",
")",
"throws",
"Exception",
"{",
"if",
"(",
"\"develop-SNAPSHOT\"",
".",
"equals",
"(",
"version",
")",
")",
"{",
"return",
"new",
"GatewayVersion",
"(",
"0",
",",
"0",
",",... | Parses a GatewayVersion from a String
@param version
@return
@throws Exception | [
"Parses",
"a",
"GatewayVersion",
"from",
"a",
"String"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/update.check/src/main/java/org/kaazing/gateway/service/update/check/GatewayVersion.java#L92-L109 |
105,440 | kaazing/gateway | service/proxy/src/main/java/org/kaazing/gateway/service/proxy/ServiceConnectManager.java | ServiceConnectManager.start | public void start() {
IoFutureListener<ConnectFuture> tmpConnectListener;
if (interval > 0) {
tmpConnectListener = new IoFutureListener<ConnectFuture>() {
@Override
public void operationComplete(ConnectFuture future) {
heartbeatFilter.setSe... | java | public void start() {
IoFutureListener<ConnectFuture> tmpConnectListener;
if (interval > 0) {
tmpConnectListener = new IoFutureListener<ConnectFuture>() {
@Override
public void operationComplete(ConnectFuture future) {
heartbeatFilter.setSe... | [
"public",
"void",
"start",
"(",
")",
"{",
"IoFutureListener",
"<",
"ConnectFuture",
">",
"tmpConnectListener",
";",
"if",
"(",
"interval",
">",
"0",
")",
"{",
"tmpConnectListener",
"=",
"new",
"IoFutureListener",
"<",
"ConnectFuture",
">",
"(",
")",
"{",
"@"... | Start the connection manager so that any pre-connections are established. | [
"Start",
"the",
"connection",
"manager",
"so",
"that",
"any",
"pre",
"-",
"connections",
"are",
"established",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/proxy/src/main/java/org/kaazing/gateway/service/proxy/ServiceConnectManager.java#L141-L181 |
105,441 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java | ConflictResolverUtils.resolveConflicts | public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) {
for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) {
Directive generalDirective = entry.getKey();
String generalValue = entry.getValue();
... | java | public static void resolveConflicts(PatternCacheControl specificPattern, PatternCacheControl generalPattern) {
for (Entry<Directive, String> entry : generalPattern.getDirectives().entrySet()) {
Directive generalDirective = entry.getKey();
String generalValue = entry.getValue();
... | [
"public",
"static",
"void",
"resolveConflicts",
"(",
"PatternCacheControl",
"specificPattern",
",",
"PatternCacheControl",
"generalPattern",
")",
"{",
"for",
"(",
"Entry",
"<",
"Directive",
",",
"String",
">",
"entry",
":",
"generalPattern",
".",
"getDirectives",
"(... | Resolves directive conflicts between two PatternCacheControl objects
@param specificPattern - the pattern which can be included in the second one
@param generalPattern - the pattern which includes the first one | [
"Resolves",
"directive",
"conflicts",
"between",
"two",
"PatternCacheControl",
"objects"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java#L52-L62 |
105,442 | kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java | ConflictResolverUtils.resolveValueConflicts | private static void resolveValueConflicts(Directive directive, String generalValue, PatternCacheControl specificPattern) {
long generalPatternValue = Long.parseLong(generalValue);
if (specificPattern.hasDirective(directive)) {
long specificPatternValue = Long.parseLong(specificPattern.getDir... | java | private static void resolveValueConflicts(Directive directive, String generalValue, PatternCacheControl specificPattern) {
long generalPatternValue = Long.parseLong(generalValue);
if (specificPattern.hasDirective(directive)) {
long specificPatternValue = Long.parseLong(specificPattern.getDir... | [
"private",
"static",
"void",
"resolveValueConflicts",
"(",
"Directive",
"directive",
",",
"String",
"generalValue",
",",
"PatternCacheControl",
"specificPattern",
")",
"{",
"long",
"generalPatternValue",
"=",
"Long",
".",
"parseLong",
"(",
"generalValue",
")",
";",
... | Resolves the conflicts for a given directive between the general pattern and the specific PatternCacheControl
@param directive
@param generalValue
@param specificPattern | [
"Resolves",
"the",
"conflicts",
"for",
"a",
"given",
"directive",
"between",
"the",
"general",
"pattern",
"and",
"the",
"specific",
"PatternCacheControl"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java#L70-L80 |
105,443 | kaazing/gateway | mina.core/integration-ognl/src/main/java/org/apache/mina/integration/ognl/AbstractPropertyAccessor.java | AbstractPropertyAccessor.getProperty | @Override
public final Object getProperty(Map context, Object target, Object oname)
throws OgnlException {
return super.getProperty(context, target, oname);
} | java | @Override
public final Object getProperty(Map context, Object target, Object oname)
throws OgnlException {
return super.getProperty(context, target, oname);
} | [
"@",
"Override",
"public",
"final",
"Object",
"getProperty",
"(",
"Map",
"context",
",",
"Object",
"target",
",",
"Object",
"oname",
")",
"throws",
"OgnlException",
"{",
"return",
"super",
".",
"getProperty",
"(",
"context",
",",
"target",
",",
"oname",
")",... | to override them. | [
"to",
"override",
"them",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/integration-ognl/src/main/java/org/apache/mina/integration/ognl/AbstractPropertyAccessor.java#L110-L114 |
105,444 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/StringUtilities.java | StringUtilities.skipLws | private static int skipLws(byte[] buf, int start) {
int i;
for (i = start; i < buf.length; i++) {
if (!isLws(buf[i])) {
return i;
}
}
return i;
} | java | private static int skipLws(byte[] buf, int start) {
int i;
for (i = start; i < buf.length; i++) {
if (!isLws(buf[i])) {
return i;
}
}
return i;
} | [
"private",
"static",
"int",
"skipLws",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"start",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"start",
";",
"i",
"<",
"buf",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"isLws",
"(",
... | Skip all linear white spaces
@param buf the buf which is being scanned for lws
@param start the offset to start at
@return the next position in buf which isn't a lws character | [
"Skip",
"all",
"linear",
"white",
"spaces"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/StringUtilities.java#L270-L280 |
105,445 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/StringUtilities.java | StringUtilities.addValueToHeader | public static void addValueToHeader(Map<String, List<String>> headers,
String key, String value, boolean singleValued) {
List<String> values = headers.get(key);
if (values == null) {
values = new ArrayList<>(1);
headers.put(key, values);
}
if (single... | java | public static void addValueToHeader(Map<String, List<String>> headers,
String key, String value, boolean singleValued) {
List<String> values = headers.get(key);
if (values == null) {
values = new ArrayList<>(1);
headers.put(key, values);
}
if (single... | [
"public",
"static",
"void",
"addValueToHeader",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
",",
"String",
"key",
",",
"String",
"value",
",",
"boolean",
"singleValued",
")",
"{",
"List",
"<",
"String",
">",
"values",
"=",... | Adds an header to the provided map of headers.
@param headers the http headers map
@param key the name of the new header to add
@param value the value of the added header
@param singleValued if true and the map already contains one value
then it is replaced by the new value. Otherwise it simply adds a new
value to thi... | [
"Adds",
"an",
"header",
"to",
"the",
"provided",
"map",
"of",
"headers",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/StringUtilities.java#L333-L347 |
105,446 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractAuthLogicHandler.java | AbstractAuthLogicHandler.addKeepAliveHeaders | public static void addKeepAliveHeaders(Map<String, List<String>> headers) {
StringUtilities.addValueToHeader(headers, "Keep-Alive",
HttpProxyConstants.DEFAULT_KEEP_ALIVE_TIME, true);
StringUtilities.addValueToHeader(headers, "Proxy-Connection",
"keep-Alive", true);
} | java | public static void addKeepAliveHeaders(Map<String, List<String>> headers) {
StringUtilities.addValueToHeader(headers, "Keep-Alive",
HttpProxyConstants.DEFAULT_KEEP_ALIVE_TIME, true);
StringUtilities.addValueToHeader(headers, "Proxy-Connection",
"keep-Alive", true);
} | [
"public",
"static",
"void",
"addKeepAliveHeaders",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"{",
"StringUtilities",
".",
"addValueToHeader",
"(",
"headers",
",",
"\"Keep-Alive\"",
",",
"HttpProxyConstants",
".",
"DEFAULT_K... | Try to force proxy connection to be kept alive.
@param headers the request headers | [
"Try",
"to",
"force",
"proxy",
"connection",
"to",
"be",
"kept",
"alive",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractAuthLogicHandler.java#L110-L115 |
105,447 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java | AwsUtils.getAccountId | public static String getAccountId() throws IOException {
// Get the MAC address of the machine.
String macUrl = getMetadataUrl() + "/network/interfaces/macs/";
String mac = invokeUrl(macUrl).trim();
// Use the MAC address to obtain the owner-id or the
// AWS AccountId.
S... | java | public static String getAccountId() throws IOException {
// Get the MAC address of the machine.
String macUrl = getMetadataUrl() + "/network/interfaces/macs/";
String mac = invokeUrl(macUrl).trim();
// Use the MAC address to obtain the owner-id or the
// AWS AccountId.
S... | [
"public",
"static",
"String",
"getAccountId",
"(",
")",
"throws",
"IOException",
"{",
"// Get the MAC address of the machine.",
"String",
"macUrl",
"=",
"getMetadataUrl",
"(",
")",
"+",
"\"/network/interfaces/macs/\"",
";",
"String",
"mac",
"=",
"invokeUrl",
"(",
"mac... | Returns the AccountId of the user who is running the instance.
@return String representing the AccountId or the owner-id
@throws java.io.IOException if failed to retrieve the AccountId using the
Cloud infrastructure | [
"Returns",
"the",
"AccountId",
"of",
"the",
"user",
"who",
"is",
"running",
"the",
"instance",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java#L68-L80 |
105,448 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java | AwsUtils.getRegion | public static String getRegion() throws IOException {
String url = getMetadataUrl() + "/placement/availability-zone";
String zone = invokeUrl(url);
zone = zone.trim();
// In case of AWS, the zone includes an extra character
// at the end such as "us-east-1a", "us-east-1b", "eu-w... | java | public static String getRegion() throws IOException {
String url = getMetadataUrl() + "/placement/availability-zone";
String zone = invokeUrl(url);
zone = zone.trim();
// In case of AWS, the zone includes an extra character
// at the end such as "us-east-1a", "us-east-1b", "eu-w... | [
"public",
"static",
"String",
"getRegion",
"(",
")",
"throws",
"IOException",
"{",
"String",
"url",
"=",
"getMetadataUrl",
"(",
")",
"+",
"\"/placement/availability-zone\"",
";",
"String",
"zone",
"=",
"invokeUrl",
"(",
"url",
")",
";",
"zone",
"=",
"zone",
... | Returns the region in which the instance is running.
@return String representing the region where the instance is
running
@throws java.io.IOException if failed to retrieve the region information
using the Cloud infrastructure | [
"Returns",
"the",
"region",
"in",
"which",
"the",
"instance",
"is",
"running",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java#L100-L112 |
105,449 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java | AwsUtils.getSecurityGroupName | public static String getSecurityGroupName() throws IOException {
// For AWS, we are returning the first security group from the list
// that is obtained by querying the meta-data.
String url = getMetadataUrl() + "/security-groups";
String groups = invokeUrl(url);
if ((groups ==... | java | public static String getSecurityGroupName() throws IOException {
// For AWS, we are returning the first security group from the list
// that is obtained by querying the meta-data.
String url = getMetadataUrl() + "/security-groups";
String groups = invokeUrl(url);
if ((groups ==... | [
"public",
"static",
"String",
"getSecurityGroupName",
"(",
")",
"throws",
"IOException",
"{",
"// For AWS, we are returning the first security group from the list",
"// that is obtained by querying the meta-data.",
"String",
"url",
"=",
"getMetadataUrl",
"(",
")",
"+",
"\"/securi... | Returns the name of the security group from the list that is
obtained from the resource vendor. An instance may belong to multiple
security groups. And, the list of security groups obtained from the
vendor may not be ordered. If the vendor supports the notion of
a default security group, then that should be returned. O... | [
"Returns",
"the",
"name",
"of",
"the",
"security",
"group",
"from",
"the",
"list",
"that",
"is",
"obtained",
"from",
"the",
"resource",
"vendor",
".",
"An",
"instance",
"may",
"belong",
"to",
"multiple",
"security",
"groups",
".",
"And",
"the",
"list",
"of... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java#L125-L139 |
105,450 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java | AwsUtils.getVersion2SignedRequest | public static String getVersion2SignedRequest(String requestMethod,
String protocol,
String endpoint,
String requestUR... | java | public static String getVersion2SignedRequest(String requestMethod,
String protocol,
String endpoint,
String requestUR... | [
"public",
"static",
"String",
"getVersion2SignedRequest",
"(",
"String",
"requestMethod",
",",
"String",
"protocol",
",",
"String",
"endpoint",
",",
"String",
"requestURI",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"awsAccessKeyId",
... | This method returns a complete signed request using HmaSHA256 algorithm
using the "SignatureVersion 2" scheme. Currently, this method creates
"SignatureVersion 2" based signed requests ONLY for the HTTP "GET"
method. It's the callers the responsibility such as "Action" and such
based on the REST API that they are tryin... | [
"This",
"method",
"returns",
"a",
"complete",
"signed",
"request",
"using",
"HmaSHA256",
"algorithm",
"using",
"the",
"SignatureVersion",
"2",
"scheme",
".",
"Currently",
"this",
"method",
"creates",
"SignatureVersion",
"2",
"based",
"signed",
"requests",
"ONLY",
... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java#L253-L289 |
105,451 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java | AwsUtils.invokeUrl | public static String invokeUrl(String url) throws IOException {
if (url == null) {
throw new IllegalArgumentException("Null parameter passed in");
}
URL urlObj;
InputStream inStream = null;
String response = null;
HttpURLConnect... | java | public static String invokeUrl(String url) throws IOException {
if (url == null) {
throw new IllegalArgumentException("Null parameter passed in");
}
URL urlObj;
InputStream inStream = null;
String response = null;
HttpURLConnect... | [
"public",
"static",
"String",
"invokeUrl",
"(",
"String",
"url",
")",
"throws",
"IOException",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null parameter passed in\"",
")",
";",
"}",
"URL",
"urlObj",
";",
... | This is a generic method to invoke the REST API. The URL that is passed
in should result in a signed request with the "Signature" query parameter
included. It's the caller's responsibility to deal with the return value
which may be a simple string or a XML response.
@param url represents a signed request wit... | [
"This",
"is",
"a",
"generic",
"method",
"to",
"invoke",
"the",
"REST",
"API",
".",
"The",
"URL",
"that",
"is",
"passed",
"in",
"should",
"result",
"in",
"a",
"signed",
"request",
"with",
"the",
"Signature",
"query",
"parameter",
"included",
".",
"It",
"s... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java#L302-L373 |
105,452 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java | AwsUtils.rfc3986Conformance | private static String rfc3986Conformance(String s) {
assert s != null;
String out;
if (s == null) {
return null;
}
try {
out = URLEncoder.encode(s, UTF8_CHARSET).replace("+", "%20")
.replace("*", "%2A").replace("%7E", "~");
}... | java | private static String rfc3986Conformance(String s) {
assert s != null;
String out;
if (s == null) {
return null;
}
try {
out = URLEncoder.encode(s, UTF8_CHARSET).replace("+", "%20")
.replace("*", "%2A").replace("%7E", "~");
}... | [
"private",
"static",
"String",
"rfc3986Conformance",
"(",
"String",
"s",
")",
"{",
"assert",
"s",
"!=",
"null",
";",
"String",
"out",
";",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"out",
"=",
"URLEncoder",
".",
... | Based on RFC 3986 and AWS doc, further encode certain characters. | [
"Based",
"on",
"RFC",
"3986",
"and",
"AWS",
"doc",
"further",
"encode",
"certain",
"characters",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/aws/AwsUtils.java#L560-L576 |
105,453 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MMFMonitoringDataManager.java | MMFMonitoringDataManager.createMonitoringFile | private void createMonitoringFile() {
String monitoringDirName = getMonitoringDirName();
monitoringDir = new File(monitoringDirName);
File monitoringFile = new File(monitoringDir, gatewayId);
IoUtil.deleteIfExists(monitoringFile);
monitorFileWriter.initialize(monitoringFile);
... | java | private void createMonitoringFile() {
String monitoringDirName = getMonitoringDirName();
monitoringDir = new File(monitoringDirName);
File monitoringFile = new File(monitoringDir, gatewayId);
IoUtil.deleteIfExists(monitoringFile);
monitorFileWriter.initialize(monitoringFile);
... | [
"private",
"void",
"createMonitoringFile",
"(",
")",
"{",
"String",
"monitoringDirName",
"=",
"getMonitoringDirName",
"(",
")",
";",
"monitoringDir",
"=",
"new",
"File",
"(",
"monitoringDirName",
")",
";",
"File",
"monitoringFile",
"=",
"new",
"File",
"(",
"moni... | Method creating the monitoring MMF | [
"Method",
"creating",
"the",
"monitoring",
"MMF"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MMFMonitoringDataManager.java#L79-L86 |
105,454 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MMFMonitoringDataManager.java | MMFMonitoringDataManager.getMonitoringDirName | private String getMonitoringDirName() {
String monitoringDirName = IoUtil.tmpDirName() + MONITOR_DIR_NAME;
if (LINUX.equalsIgnoreCase(System.getProperty(OS_NAME_SYSTEM_PROPERTY))) {
final File devShmDir = new File(LINUX_DEV_SHM_DIRECTORY);
if (devShmDir.exists()) {
... | java | private String getMonitoringDirName() {
String monitoringDirName = IoUtil.tmpDirName() + MONITOR_DIR_NAME;
if (LINUX.equalsIgnoreCase(System.getProperty(OS_NAME_SYSTEM_PROPERTY))) {
final File devShmDir = new File(LINUX_DEV_SHM_DIRECTORY);
if (devShmDir.exists()) {
... | [
"private",
"String",
"getMonitoringDirName",
"(",
")",
"{",
"String",
"monitoringDirName",
"=",
"IoUtil",
".",
"tmpDirName",
"(",
")",
"+",
"MONITOR_DIR_NAME",
";",
"if",
"(",
"LINUX",
".",
"equalsIgnoreCase",
"(",
"System",
".",
"getProperty",
"(",
"OS_NAME_SYS... | This method is used to compute the monitoring directory name which will be used by Agrona in order
to create a file in which to write the data in shared memory.
The monitoring directory will be dependent of the operating system.
For Linux we will use the OS implementation of the shared memory. So the directory will b... | [
"This",
"method",
"is",
"used",
"to",
"compute",
"the",
"monitoring",
"directory",
"name",
"which",
"will",
"be",
"used",
"by",
"Agrona",
"in",
"order",
"to",
"create",
"a",
"file",
"in",
"which",
"to",
"write",
"the",
"data",
"in",
"shared",
"memory",
"... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MMFMonitoringDataManager.java#L100-L112 |
105,455 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/der/DerId.java | DerId.decode | public static DerId decode(ByteBuffer buf) {
if (buf == null || buf.remaining() == 0) {
throw new IllegalArgumentException("Null or empty buffer");
}
DerId id = new DerId();
byte first = buf.get(); // first octet
// Bits 8 and 7 represent the tag class
id.t... | java | public static DerId decode(ByteBuffer buf) {
if (buf == null || buf.remaining() == 0) {
throw new IllegalArgumentException("Null or empty buffer");
}
DerId id = new DerId();
byte first = buf.get(); // first octet
// Bits 8 and 7 represent the tag class
id.t... | [
"public",
"static",
"DerId",
"decode",
"(",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"buf",
"==",
"null",
"||",
"buf",
".",
"remaining",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null or empty buffer\"",
")",
";",
... | Decodes identifier octets from a DER-encoded message.
@param buf
the buffer containing the DER-encoded message
@return the DER identifier | [
"Decodes",
"identifier",
"octets",
"from",
"a",
"DER",
"-",
"encoded",
"message",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerId.java#L86-L121 |
105,456 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/der/DerId.java | DerId.matches | public boolean matches(TagClass tagClass, EncodingType encodingType, int tagNumber) {
return this.tagClass == tagClass && this.encodingType == encodingType && this.tagNumber == tagNumber;
} | java | public boolean matches(TagClass tagClass, EncodingType encodingType, int tagNumber) {
return this.tagClass == tagClass && this.encodingType == encodingType && this.tagNumber == tagNumber;
} | [
"public",
"boolean",
"matches",
"(",
"TagClass",
"tagClass",
",",
"EncodingType",
"encodingType",
",",
"int",
"tagNumber",
")",
"{",
"return",
"this",
".",
"tagClass",
"==",
"tagClass",
"&&",
"this",
".",
"encodingType",
"==",
"encodingType",
"&&",
"this",
"."... | Tests whether this DER identifier matches the specified tag class, encoding type and tag number.
@param tagClass
the tag class to match against
@param encodingType
the encoding type to match against
@param tagNumber
the tag number to match against
@return whether there's a match | [
"Tests",
"whether",
"this",
"DER",
"identifier",
"matches",
"the",
"specified",
"tag",
"class",
"encoding",
"type",
"and",
"tag",
"number",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerId.java#L134-L136 |
105,457 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/core/session/AbstractIoSessionEx.java | AbstractIoSessionEx.setSubject | protected void setSubject(Subject subject) {
Subject currentSubject = this.subject;
if (!(currentSubject == null && subject == null)) {
this.subject = subject;
if (currentThread() == ioThread) {
notifySubjectChanged(subject);
}
else {
... | java | protected void setSubject(Subject subject) {
Subject currentSubject = this.subject;
if (!(currentSubject == null && subject == null)) {
this.subject = subject;
if (currentThread() == ioThread) {
notifySubjectChanged(subject);
}
else {
... | [
"protected",
"void",
"setSubject",
"(",
"Subject",
"subject",
")",
"{",
"Subject",
"currentSubject",
"=",
"this",
".",
"subject",
";",
"if",
"(",
"!",
"(",
"currentSubject",
"==",
"null",
"&&",
"subject",
"==",
"null",
")",
")",
"{",
"this",
".",
"subjec... | Memorizes the Subject representing the current logged on user and fires any
currently registered SubjectChangeListeners | [
"Memorizes",
"the",
"Subject",
"representing",
"the",
"current",
"logged",
"on",
"user",
"and",
"fires",
"any",
"currently",
"registered",
"SubjectChangeListeners"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/core/session/AbstractIoSessionEx.java#L242-L259 |
105,458 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/entity/manager/impl/ServiceCounterManagerImpl.java | ServiceCounterManagerImpl.initializeSessionCounters | private void initializeSessionCounters() {
if (monitoringEntityFactory == null) {
return;
}
numberOfSessionsCounter = monitoringEntityFactory.makeLongMonitoringCounter(CURRENT_NUMBER_OF_SESSIONS);
numberOfNativeSessionsCounter = monitoringEntityFactory.makeLongMonitoringCount... | java | private void initializeSessionCounters() {
if (monitoringEntityFactory == null) {
return;
}
numberOfSessionsCounter = monitoringEntityFactory.makeLongMonitoringCounter(CURRENT_NUMBER_OF_SESSIONS);
numberOfNativeSessionsCounter = monitoringEntityFactory.makeLongMonitoringCount... | [
"private",
"void",
"initializeSessionCounters",
"(",
")",
"{",
"if",
"(",
"monitoringEntityFactory",
"==",
"null",
")",
"{",
"return",
";",
"}",
"numberOfSessionsCounter",
"=",
"monitoringEntityFactory",
".",
"makeLongMonitoringCounter",
"(",
"CURRENT_NUMBER_OF_SESSIONS",... | Method initializing the service session counters
@return | [
"Method",
"initializing",
"the",
"service",
"session",
"counters"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/entity/manager/impl/ServiceCounterManagerImpl.java#L134-L146 |
105,459 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/core/future/DefaultIoFutureEx.java | DefaultIoFutureEx.reset | @Override
public void reset(IoSession session) {
synchronized (lock) {
if (!ready && this.session != null) {
throw new IllegalStateException("Cannot reset a future that has not yet completed");
}
this.session = session;
this.firstListener = nu... | java | @Override
public void reset(IoSession session) {
synchronized (lock) {
if (!ready && this.session != null) {
throw new IllegalStateException("Cannot reset a future that has not yet completed");
}
this.session = session;
this.firstListener = nu... | [
"@",
"Override",
"public",
"void",
"reset",
"(",
"IoSession",
"session",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"!",
"ready",
"&&",
"this",
".",
"session",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cann... | Call this method to reuse a future after it has been completed | [
"Call",
"this",
"method",
"to",
"reuse",
"a",
"future",
"after",
"it",
"has",
"been",
"completed"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/core/future/DefaultIoFutureEx.java#L75-L89 |
105,460 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java | DerUtils.decodeLength | public static int decodeLength(ByteBuffer buf) {
if (buf == null || buf.remaining() == 0) {
throw new IllegalArgumentException("Null or empty buffer");
}
int len = 0;
byte first = buf.get();
if (first >> 7 == 0) {
// Bit 8 is zero: Short form
... | java | public static int decodeLength(ByteBuffer buf) {
if (buf == null || buf.remaining() == 0) {
throw new IllegalArgumentException("Null or empty buffer");
}
int len = 0;
byte first = buf.get();
if (first >> 7 == 0) {
// Bit 8 is zero: Short form
... | [
"public",
"static",
"int",
"decodeLength",
"(",
"ByteBuffer",
"buf",
")",
"{",
"if",
"(",
"buf",
"==",
"null",
"||",
"buf",
".",
"remaining",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null or empty buffer\"",
")",
"... | Decode octets and extract the length information from a DER-encoded message.
@param buf
the DER-encoded data buffer with position immediately after the DER-identifier octets
@return the length of the DER-encoded contents | [
"Decode",
"octets",
"and",
"extract",
"the",
"length",
"information",
"from",
"a",
"DER",
"-",
"encoded",
"message",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java#L34-L60 |
105,461 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java | DerUtils.decodeIdAndLength | public static DerId decodeIdAndLength(ByteBuffer buf) {
DerId id = DerId.decode(buf);
DerUtils.decodeLength(buf);
return id;
} | java | public static DerId decodeIdAndLength(ByteBuffer buf) {
DerId id = DerId.decode(buf);
DerUtils.decodeLength(buf);
return id;
} | [
"public",
"static",
"DerId",
"decodeIdAndLength",
"(",
"ByteBuffer",
"buf",
")",
"{",
"DerId",
"id",
"=",
"DerId",
".",
"decode",
"(",
"buf",
")",
";",
"DerUtils",
".",
"decodeLength",
"(",
"buf",
")",
";",
"return",
"id",
";",
"}"
] | Decodes ID and length octets from a DER-encoded message.
@param buf
the buffer with the DER-encoded message
@return the ID | [
"Decodes",
"ID",
"and",
"length",
"octets",
"from",
"a",
"DER",
"-",
"encoded",
"message",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java#L69-L73 |
105,462 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java | DerUtils.encodeIdAndLength | public static int encodeIdAndLength(DerId.TagClass tagClass, DerId.EncodingType encodingType, int tagNumber,
int contentLength, ByteBuffer buf) {
int origPos = buf.position();
int pos = buf.position();
// Write out length octets
if (contentLength < 0) {
throw new... | java | public static int encodeIdAndLength(DerId.TagClass tagClass, DerId.EncodingType encodingType, int tagNumber,
int contentLength, ByteBuffer buf) {
int origPos = buf.position();
int pos = buf.position();
// Write out length octets
if (contentLength < 0) {
throw new... | [
"public",
"static",
"int",
"encodeIdAndLength",
"(",
"DerId",
".",
"TagClass",
"tagClass",
",",
"DerId",
".",
"EncodingType",
"encodingType",
",",
"int",
"tagNumber",
",",
"int",
"contentLength",
",",
"ByteBuffer",
"buf",
")",
"{",
"int",
"origPos",
"=",
"buf"... | DER-encode content into a provided buffer.
@param tagClass
the tag class
@param encodingType
the tag encoding type
@param tagNumber
the tag number
@param contentLength
the length of the content (presumed to be in the buffer)
@param buf
the buffer with sufficient space before the current position to add the length and ... | [
"DER",
"-",
"encode",
"content",
"into",
"a",
"provided",
"buffer",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java#L90-L170 |
105,463 | kaazing/gateway | util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java | DerUtils.sizeOf | public static int sizeOf(int tagNumber, int contentLength) {
if (tagNumber < 0 || contentLength < 0) {
throw new IllegalArgumentException("Invalid tagNumber/contentLength: " + tagNumber + ", " + contentLength);
}
int len = 0;
// ID octets
if (tagNumber <= 30) {
... | java | public static int sizeOf(int tagNumber, int contentLength) {
if (tagNumber < 0 || contentLength < 0) {
throw new IllegalArgumentException("Invalid tagNumber/contentLength: " + tagNumber + ", " + contentLength);
}
int len = 0;
// ID octets
if (tagNumber <= 30) {
... | [
"public",
"static",
"int",
"sizeOf",
"(",
"int",
"tagNumber",
",",
"int",
"contentLength",
")",
"{",
"if",
"(",
"tagNumber",
"<",
"0",
"||",
"contentLength",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid tagNumber/contentLength:... | Computes the DER-encoded size of content with a specified tag number.
@param tagNumber
the DER tag number in the identifier
@param contentLength
the length of the content in bytes
@return | [
"Computes",
"the",
"DER",
"-",
"encoded",
"size",
"of",
"content",
"with",
"a",
"specified",
"tag",
"number",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/util/src/main/java/org/kaazing/gateway/util/der/DerUtils.java#L181-L206 |
105,464 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/NamePreservingRunnable.java | NamePreservingRunnable.run | public void run() {
Thread currentThread = Thread.currentThread();
String oldName = currentThread.getName();
if (newName != null) {
setName(currentThread, newName);
}
try {
runnable.run();
} finally {
setName(currentThread, oldName);
... | java | public void run() {
Thread currentThread = Thread.currentThread();
String oldName = currentThread.getName();
if (newName != null) {
setName(currentThread, newName);
}
try {
runnable.run();
} finally {
setName(currentThread, oldName);
... | [
"public",
"void",
"run",
"(",
")",
"{",
"Thread",
"currentThread",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"String",
"oldName",
"=",
"currentThread",
".",
"getName",
"(",
")",
";",
"if",
"(",
"newName",
"!=",
"null",
")",
"{",
"setName",
"(... | Run the runnable after having renamed the current thread's name
to the new name. When the runnable has completed, set back the
current thread name back to its origin. | [
"Run",
"the",
"runnable",
"after",
"having",
"renamed",
"the",
"current",
"thread",
"s",
"name",
"to",
"the",
"new",
"name",
".",
"When",
"the",
"runnable",
"has",
"completed",
"set",
"back",
"the",
"current",
"thread",
"name",
"back",
"to",
"its",
"origin... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/NamePreservingRunnable.java#L52-L65 |
105,465 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/ProxyConnector.java | ProxyConnector.setProxyIoSession | public void setProxyIoSession(ProxyIoSession proxyIoSession) {
if (proxyIoSession == null) {
throw new NullPointerException("proxySession object cannot be null");
}
if (proxyIoSession.getProxyAddress() == null) {
throw new NullPointerException(
"proxy... | java | public void setProxyIoSession(ProxyIoSession proxyIoSession) {
if (proxyIoSession == null) {
throw new NullPointerException("proxySession object cannot be null");
}
if (proxyIoSession.getProxyAddress() == null) {
throw new NullPointerException(
"proxy... | [
"public",
"void",
"setProxyIoSession",
"(",
"ProxyIoSession",
"proxyIoSession",
")",
"{",
"if",
"(",
"proxyIoSession",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"proxySession object cannot be null\"",
")",
";",
"}",
"if",
"(",
"proxyIoSe... | Sets the proxy session object of this connector.
@param proxyIoSession the configuration of this connector. | [
"Sets",
"the",
"proxy",
"session",
"object",
"of",
"this",
"connector",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/ProxyConnector.java#L127-L140 |
105,466 | kaazing/gateway | resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResourceAddressFactory.java | ResourceAddressFactory.newResourceAddress | public ResourceAddress newResourceAddress(String location, String nextProtocol) {
if (nextProtocol != null) {
ResourceOptions options = ResourceOptions.FACTORY.newResourceOptions();
options.setOption(NEXT_PROTOCOL, nextProtocol);
return newResourceAddress(location, options);
... | java | public ResourceAddress newResourceAddress(String location, String nextProtocol) {
if (nextProtocol != null) {
ResourceOptions options = ResourceOptions.FACTORY.newResourceOptions();
options.setOption(NEXT_PROTOCOL, nextProtocol);
return newResourceAddress(location, options);
... | [
"public",
"ResourceAddress",
"newResourceAddress",
"(",
"String",
"location",
",",
"String",
"nextProtocol",
")",
"{",
"if",
"(",
"nextProtocol",
"!=",
"null",
")",
"{",
"ResourceOptions",
"options",
"=",
"ResourceOptions",
".",
"FACTORY",
".",
"newResourceOptions",... | convenience method only, consider removing from API | [
"convenience",
"method",
"only",
"consider",
"removing",
"from",
"API"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResourceAddressFactory.java#L117-L126 |
105,467 | kaazing/gateway | transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpLoginSecurityFilter.java | HttpLoginSecurityFilter.loginMissingToken | private boolean loginMissingToken(NextFilter nextFilter,
IoSession session,
HttpRequestMessage httpRequest,
AuthenticationToken authToken,
TypedCallbackHandlerMap addit... | java | private boolean loginMissingToken(NextFilter nextFilter,
IoSession session,
HttpRequestMessage httpRequest,
AuthenticationToken authToken,
TypedCallbackHandlerMap addit... | [
"private",
"boolean",
"loginMissingToken",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
",",
"HttpRequestMessage",
"httpRequest",
",",
"AuthenticationToken",
"authToken",
",",
"TypedCallbackHandlerMap",
"additionalCallbacks",
",",
"HttpRealmInfo",
"[",
"]",... | Handle the initial "login" attempt where the client has presumably
not sent any specific authentication token yet.
@return always returns false. | [
"Handle",
"the",
"initial",
"login",
"attempt",
"where",
"the",
"client",
"has",
"presumably",
"not",
"sent",
"any",
"specific",
"authentication",
"token",
"yet",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/http/src/main/java/org/kaazing/gateway/transport/http/bridge/filter/HttpLoginSecurityFilter.java#L159-L234 |
105,468 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/logging/MdcInjectionFilter.java | MdcInjectionFilter.setProperty | public static void setProperty(IoSession session, String key, String value) {
if (key == null) {
throw new NullPointerException("key should not be null");
}
if (value == null) {
removeProperty(session, key);
}
Map<String, String> context = getContext(sessi... | java | public static void setProperty(IoSession session, String key, String value) {
if (key == null) {
throw new NullPointerException("key should not be null");
}
if (value == null) {
removeProperty(session, key);
}
Map<String, String> context = getContext(sessi... | [
"public",
"static",
"void",
"setProperty",
"(",
"IoSession",
"session",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"key should not be null\"",
")",
";",
"}"... | Add a property to the context for the given session
This property will be added to the MDC for all subsequent events
@param session The session for which you want to set a property
@param key The name of the property (should not be null)
@param value The value of the property | [
"Add",
"a",
"property",
"to",
"the",
"context",
"for",
"the",
"given",
"session",
"This",
"property",
"will",
"be",
"added",
"to",
"the",
"MDC",
"for",
"all",
"subsequent",
"events"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/logging/MdcInjectionFilter.java#L229-L239 |
105,469 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/util/ExceptionMonitor.java | ExceptionMonitor.exceptionCaught | public void exceptionCaught(Throwable cause, IoSession s) {
if (s == null) {
org.apache.mina.util.ExceptionMonitor.getInstance().exceptionCaught(cause);
} else {
exceptionCaught0(cause, s);
}
} | java | public void exceptionCaught(Throwable cause, IoSession s) {
if (s == null) {
org.apache.mina.util.ExceptionMonitor.getInstance().exceptionCaught(cause);
} else {
exceptionCaught0(cause, s);
}
} | [
"public",
"void",
"exceptionCaught",
"(",
"Throwable",
"cause",
",",
"IoSession",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"org",
".",
"apache",
".",
"mina",
".",
"util",
".",
"ExceptionMonitor",
".",
"getInstance",
"(",
")",
".",
"except... | Invoked when there are any uncaught exceptions. | [
"Invoked",
"when",
"there",
"are",
"any",
"uncaught",
"exceptions",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/util/ExceptionMonitor.java#L60-L66 |
105,470 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java | ByteArrayList.removeFirst | public Node removeFirst()
{
Node node = header.getNextNode();
firstByte += node.ba.last();
return removeNode( node );
} | java | public Node removeFirst()
{
Node node = header.getNextNode();
firstByte += node.ba.last();
return removeNode( node );
} | [
"public",
"Node",
"removeFirst",
"(",
")",
"{",
"Node",
"node",
"=",
"header",
".",
"getNextNode",
"(",
")",
";",
"firstByte",
"+=",
"node",
".",
"ba",
".",
"last",
"(",
")",
";",
"return",
"removeNode",
"(",
"node",
")",
";",
"}"
] | Removes the first node from this list
@return
The node that was removed | [
"Removes",
"the",
"first",
"node",
"from",
"this",
"list"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java#L147-L152 |
105,471 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java | ByteArrayList.removeLast | public Node removeLast()
{
Node node = header.getPreviousNode();
lastByte -= node.ba.last();
return removeNode( node );
} | java | public Node removeLast()
{
Node node = header.getPreviousNode();
lastByte -= node.ba.last();
return removeNode( node );
} | [
"public",
"Node",
"removeLast",
"(",
")",
"{",
"Node",
"node",
"=",
"header",
".",
"getPreviousNode",
"(",
")",
";",
"lastByte",
"-=",
"node",
".",
"ba",
".",
"last",
"(",
")",
";",
"return",
"removeNode",
"(",
"node",
")",
";",
"}"
] | Removes the last node in this list
@return
The node that was taken off of the list | [
"Removes",
"the",
"last",
"node",
"in",
"this",
"list"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java#L160-L165 |
105,472 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java | ByteArrayList.addNode | protected void addNode( Node nodeToInsert, Node insertBeforeNode )
{
// Insert node.
nodeToInsert.next = insertBeforeNode;
nodeToInsert.previous = insertBeforeNode.previous;
insertBeforeNode.previous.next = nodeToInsert;
insertBeforeNode.previous = nodeToInsert;
} | java | protected void addNode( Node nodeToInsert, Node insertBeforeNode )
{
// Insert node.
nodeToInsert.next = insertBeforeNode;
nodeToInsert.previous = insertBeforeNode.previous;
insertBeforeNode.previous.next = nodeToInsert;
insertBeforeNode.previous = nodeToInsert;
} | [
"protected",
"void",
"addNode",
"(",
"Node",
"nodeToInsert",
",",
"Node",
"insertBeforeNode",
")",
"{",
"// Insert node.",
"nodeToInsert",
".",
"next",
"=",
"insertBeforeNode",
";",
"nodeToInsert",
".",
"previous",
"=",
"insertBeforeNode",
".",
"previous",
";",
"i... | Inserts a new node into the list.
@param nodeToInsert new node to insert
@param insertBeforeNode node to insert before
@throws NullPointerException if either node is null | [
"Inserts",
"a",
"new",
"node",
"into",
"the",
"list",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java#L177-L184 |
105,473 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java | ByteArrayList.removeNode | protected Node removeNode( Node node )
{
// Remove node.
node.previous.next = node.next;
node.next.previous = node.previous;
node.removed = true;
return node;
} | java | protected Node removeNode( Node node )
{
// Remove node.
node.previous.next = node.next;
node.next.previous = node.previous;
node.removed = true;
return node;
} | [
"protected",
"Node",
"removeNode",
"(",
"Node",
"node",
")",
"{",
"// Remove node.",
"node",
".",
"previous",
".",
"next",
"=",
"node",
".",
"next",
";",
"node",
".",
"next",
".",
"previous",
"=",
"node",
".",
"previous",
";",
"node",
".",
"removed",
"... | Removes the specified node from the list.
@param node the node to remove
@throws NullPointerException if <code>node</code> is null | [
"Removes",
"the",
"specified",
"node",
"from",
"the",
"list",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/util/byteaccess/ByteArrayList.java#L193-L200 |
105,474 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/executor/DefaultIoEventSizeEstimator.java | DefaultIoEventSizeEstimator.estimateSize | public int estimateSize(Object message) {
if (message == null) {
return 8;
}
int answer = 8 + estimateSize(message.getClass(), null);
if (message instanceof IoBuffer) {
answer += ((IoBuffer) message).remaining();
} else if (message instanceof WriteReques... | java | public int estimateSize(Object message) {
if (message == null) {
return 8;
}
int answer = 8 + estimateSize(message.getClass(), null);
if (message instanceof IoBuffer) {
answer += ((IoBuffer) message).remaining();
} else if (message instanceof WriteReques... | [
"public",
"int",
"estimateSize",
"(",
"Object",
"message",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"return",
"8",
";",
"}",
"int",
"answer",
"=",
"8",
"+",
"estimateSize",
"(",
"message",
".",
"getClass",
"(",
")",
",",
"null",
")",
... | Estimate the size of an Objecr in number of bytes
@param message The object to estimate
@return The estimated size of the object | [
"Estimate",
"the",
"size",
"of",
"an",
"Objecr",
"in",
"number",
"of",
"bytes"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/DefaultIoEventSizeEstimator.java#L74-L94 |
105,475 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java | ByteUtilities.networkByteOrderToInt | public static int networkByteOrderToInt(byte[] buf, int start, int count) {
if (count > 4) {
throw new IllegalArgumentException(
"Cannot handle more than 4 bytes");
}
int result = 0;
for (int i = 0; i < count; i++) {
result <<= 8;
... | java | public static int networkByteOrderToInt(byte[] buf, int start, int count) {
if (count > 4) {
throw new IllegalArgumentException(
"Cannot handle more than 4 bytes");
}
int result = 0;
for (int i = 0; i < count; i++) {
result <<= 8;
... | [
"public",
"static",
"int",
"networkByteOrderToInt",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"start",
",",
"int",
"count",
")",
"{",
"if",
"(",
"count",
">",
"4",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot handle more than 4 bytes\""... | Returns the integer represented by up to 4 bytes in network byte order.
@param buf the buffer to read the bytes from
@param start
@param count
@return | [
"Returns",
"the",
"integer",
"represented",
"by",
"up",
"to",
"4",
"bytes",
"in",
"network",
"byte",
"order",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java#L36-L50 |
105,476 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java | ByteUtilities.intToNetworkByteOrder | public static byte[] intToNetworkByteOrder(int num, int count) {
byte[] buf = new byte[count];
intToNetworkByteOrder(num, buf, 0, count);
return buf;
} | java | public static byte[] intToNetworkByteOrder(int num, int count) {
byte[] buf = new byte[count];
intToNetworkByteOrder(num, buf, 0, count);
return buf;
} | [
"public",
"static",
"byte",
"[",
"]",
"intToNetworkByteOrder",
"(",
"int",
"num",
",",
"int",
"count",
")",
"{",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"count",
"]",
";",
"intToNetworkByteOrder",
"(",
"num",
",",
"buf",
",",
"0",
",",
"cou... | Encodes an integer into up to 4 bytes in network byte order.
@param num the int to convert to a byte array
@param count the number of reserved bytes for the write operation
@return the resulting byte array | [
"Encodes",
"an",
"integer",
"into",
"up",
"to",
"4",
"bytes",
"in",
"network",
"byte",
"order",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java#L59-L64 |
105,477 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java | ByteUtilities.asHex | public static String asHex(byte[] bytes, String separator) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < bytes.length; i++) {
String code = Integer.toHexString(bytes[i] & 0xFF);
if ((bytes[i] & 0xFF) < 16) {
sb.append('0');
}
... | java | public static String asHex(byte[] bytes, String separator) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < bytes.length; i++) {
String code = Integer.toHexString(bytes[i] & 0xFF);
if ((bytes[i] & 0xFF) < 16) {
sb.append('0');
}
... | [
"public",
"static",
"String",
"asHex",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"separator",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bytes",
".",
"length",
... | Returns a hexadecimal representation of the given byte array.
@param bytes the array to output to an hex string
@param separator the separator to use between each byte in the output
string. If null no char is inserted between each byte value.
@return the hex representation as a string | [
"Returns",
"a",
"hexadecimal",
"representation",
"of",
"the",
"given",
"byte",
"array",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java#L246-L262 |
105,478 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java | ByteUtilities.asByteArray | public static byte[] asByteArray(String hex) {
byte[] bts = new byte[hex.length() / 2];
for (int i = 0; i < bts.length; i++) {
bts[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2),
16);
}
return bts;
} | java | public static byte[] asByteArray(String hex) {
byte[] bts = new byte[hex.length() / 2];
for (int i = 0; i < bts.length; i++) {
bts[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2),
16);
}
return bts;
} | [
"public",
"static",
"byte",
"[",
"]",
"asByteArray",
"(",
"String",
"hex",
")",
"{",
"byte",
"[",
"]",
"bts",
"=",
"new",
"byte",
"[",
"hex",
".",
"length",
"(",
")",
"/",
"2",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bts",... | Converts a hex string representation to a byte array.
@param hex the string holding the hex values
@return the resulting byte array | [
"Converts",
"a",
"hex",
"string",
"representation",
"to",
"a",
"byte",
"array",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java#L270-L278 |
105,479 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/service/IoServiceStatistics.java | IoServiceStatistics.updateThroughput | public void updateThroughput(long currentTime) {
synchronized (throughputCalculationLock) {
int interval = (int) (currentTime - lastThroughputCalculationTime);
long minInterval = getThroughputCalculationIntervalInMillis();
if (minInterval == 0 || interval < minInterval) {
... | java | public void updateThroughput(long currentTime) {
synchronized (throughputCalculationLock) {
int interval = (int) (currentTime - lastThroughputCalculationTime);
long minInterval = getThroughputCalculationIntervalInMillis();
if (minInterval == 0 || interval < minInterval) {
... | [
"public",
"void",
"updateThroughput",
"(",
"long",
"currentTime",
")",
"{",
"synchronized",
"(",
"throughputCalculationLock",
")",
"{",
"int",
"interval",
"=",
"(",
"int",
")",
"(",
"currentTime",
"-",
"lastThroughputCalculationTime",
")",
";",
"long",
"minInterva... | Updates the throughput counters. | [
"Updates",
"the",
"throughput",
"counters",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/service/IoServiceStatistics.java#L264-L306 |
105,480 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java | AbstractPollingIoProcessor.nextThreadName | private String nextThreadName() {
Class<?> cls = getClass();
int newThreadId;
// We synchronize this block to avoid a concurrent access to
// the actomicInteger (it can be modified by another thread, while
// being seen as null by another thread)
synchronized (threadIds... | java | private String nextThreadName() {
Class<?> cls = getClass();
int newThreadId;
// We synchronize this block to avoid a concurrent access to
// the actomicInteger (it can be modified by another thread, while
// being seen as null by another thread)
synchronized (threadIds... | [
"private",
"String",
"nextThreadName",
"(",
")",
"{",
"Class",
"<",
"?",
">",
"cls",
"=",
"getClass",
"(",
")",
";",
"int",
"newThreadId",
";",
"// We synchronize this block to avoid a concurrent access to ",
"// the actomicInteger (it can be modified by another thread, while... | Compute the thread ID for this class instance. As we may have different
classes, we store the last ID number into a Map associating the class
name to the last assigned ID.
@return a name for the current thread, based on the class name and
an incremental value, starting at 1. | [
"Compute",
"the",
"thread",
"ID",
"for",
"this",
"class",
"instance",
".",
"As",
"we",
"may",
"have",
"different",
"classes",
"we",
"store",
"the",
"last",
"ID",
"number",
"into",
"a",
"Map",
"associating",
"the",
"class",
"name",
"to",
"the",
"last",
"a... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java#L132-L157 |
105,481 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java | AbstractPollingIoProcessor.startupProcessor | private void startupProcessor() {
Processor processor = processorRef.get();
if (processor == null) {
processor = new Processor();
if (processorRef.compareAndSet(null, processor)) {
executor.execute(new NamePreservingRunnable(processor,
thre... | java | private void startupProcessor() {
Processor processor = processorRef.get();
if (processor == null) {
processor = new Processor();
if (processorRef.compareAndSet(null, processor)) {
executor.execute(new NamePreservingRunnable(processor,
thre... | [
"private",
"void",
"startupProcessor",
"(",
")",
"{",
"Processor",
"processor",
"=",
"processorRef",
".",
"get",
"(",
")",
";",
"if",
"(",
"processor",
"==",
"null",
")",
"{",
"processor",
"=",
"new",
"Processor",
"(",
")",
";",
"if",
"(",
"processorRef"... | Starts the inner Processor, asking the executor to pick a thread in its
pool. The Runnable will be renamed | [
"Starts",
"the",
"inner",
"Processor",
"asking",
"the",
"executor",
"to",
"pick",
"a",
"thread",
"in",
"its",
"pool",
".",
"The",
"Runnable",
"will",
"be",
"renamed"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java#L409-L422 |
105,482 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java | AbstractPollingIoProcessor.handleNewSessions | private int handleNewSessions() {
int addedSessions = 0;
for (;;) {
T session = newSessions.poll();
if (session == null) {
// All new sessions have been handled
break;
}
if (addNow(session)) {
// A new ses... | java | private int handleNewSessions() {
int addedSessions = 0;
for (;;) {
T session = newSessions.poll();
if (session == null) {
// All new sessions have been handled
break;
}
if (addNow(session)) {
// A new ses... | [
"private",
"int",
"handleNewSessions",
"(",
")",
"{",
"int",
"addedSessions",
"=",
"0",
";",
"for",
"(",
";",
";",
")",
"{",
"T",
"session",
"=",
"newSessions",
".",
"poll",
"(",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"// All new ses... | Loops over the new sessions blocking queue and returns
the number of sessions which are effectively created
@return The number of new sessions | [
"Loops",
"over",
"the",
"new",
"sessions",
"blocking",
"queue",
"and",
"returns",
"the",
"number",
"of",
"sessions",
"which",
"are",
"effectively",
"created"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java#L430-L448 |
105,483 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java | AbstractPollingIoProcessor.process | private void process(T session) {
// Process Reads
if (isReadable(session) && !session.isReadSuspended()) {
read(session);
}
// Process writes
if (isWritable(session) && !session.isWriteSuspended()) {
scheduleFlush(session);
}
} | java | private void process(T session) {
// Process Reads
if (isReadable(session) && !session.isReadSuspended()) {
read(session);
}
// Process writes
if (isWritable(session) && !session.isWriteSuspended()) {
scheduleFlush(session);
}
} | [
"private",
"void",
"process",
"(",
"T",
"session",
")",
"{",
"// Process Reads",
"if",
"(",
"isReadable",
"(",
"session",
")",
"&&",
"!",
"session",
".",
"isReadSuspended",
"(",
")",
")",
"{",
"read",
"(",
"session",
")",
";",
"}",
"// Process writes",
"... | Deal with session ready for the read or write operations, or both. | [
"Deal",
"with",
"session",
"ready",
"for",
"the",
"read",
"or",
"write",
"operations",
"or",
"both",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java#L602-L612 |
105,484 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java | AbstractPollingIoProcessor.updateTrafficMask | private void updateTrafficMask() {
int queueSize = trafficControllingSessions.size();
while (queueSize > 0) {
T session = trafficControllingSessions.poll();
if (session == null) {
return;
}
SessionState state = getState(session);... | java | private void updateTrafficMask() {
int queueSize = trafficControllingSessions.size();
while (queueSize > 0) {
T session = trafficControllingSessions.poll();
if (session == null) {
return;
}
SessionState state = getState(session);... | [
"private",
"void",
"updateTrafficMask",
"(",
")",
"{",
"int",
"queueSize",
"=",
"trafficControllingSessions",
".",
"size",
"(",
")",
";",
"while",
"(",
"queueSize",
">",
"0",
")",
"{",
"T",
"session",
"=",
"trafficControllingSessions",
".",
"poll",
"(",
")",... | Update the trafficControl for all the session which has
just been opened. | [
"Update",
"the",
"trafficControl",
"for",
"all",
"the",
"session",
"which",
"has",
"just",
"been",
"opened",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/polling/AbstractPollingIoProcessor.java#L900-L937 |
105,485 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/AbstractManagementBean.java | AbstractManagementBean.sendSummaryData | public boolean sendSummaryData() {
if (clearDirty()) {
//System.out.println("#### sendSummaryData for " + Utils.getClassName(this));
// we had something that changed, so send the notification of summaryData
String summaryData = getSummaryData();
for (SummaryData... | java | public boolean sendSummaryData() {
if (clearDirty()) {
//System.out.println("#### sendSummaryData for " + Utils.getClassName(this));
// we had something that changed, so send the notification of summaryData
String summaryData = getSummaryData();
for (SummaryData... | [
"public",
"boolean",
"sendSummaryData",
"(",
")",
"{",
"if",
"(",
"clearDirty",
"(",
")",
")",
"{",
"//System.out.println(\"#### sendSummaryData for \" + Utils.getClassName(this));",
"// we had something that changed, so send the notification of summaryData",
"String",
"summaryData",... | Send the summary data, returning whether anything actually needed to be sent.
@return true iff any summary data needed to be sent | [
"Send",
"the",
"summary",
"data",
"returning",
"whether",
"anything",
"actually",
"needed",
"to",
"be",
"sent",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/AbstractManagementBean.java#L159-L178 |
105,486 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java | ProxyFilter.messageReceived | @Override
public void messageReceived(final NextFilter nextFilter,
final IoSession session, final Object message)
throws ProxyAuthException {
ProxyLogicHandler handler = getProxyHandler(session);
synchronized (handler) {
IoBuffer buf = (IoBuffer) message;
... | java | @Override
public void messageReceived(final NextFilter nextFilter,
final IoSession session, final Object message)
throws ProxyAuthException {
ProxyLogicHandler handler = getProxyHandler(session);
synchronized (handler) {
IoBuffer buf = (IoBuffer) message;
... | [
"@",
"Override",
"public",
"void",
"messageReceived",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"IoSession",
"session",
",",
"final",
"Object",
"message",
")",
"throws",
"ProxyAuthException",
"{",
"ProxyLogicHandler",
"handler",
"=",
"getProxyHandler",
... | Receives data from the remote host, passes to the handler if a handshake is in progress,
otherwise passes on transparently.
@param nextFilter the next filter in filter chain
@param session the session object
@param message the object holding the received data | [
"Receives",
"data",
"from",
"the",
"remote",
"host",
"passes",
"to",
"the",
"handler",
"if",
"a",
"handshake",
"is",
"in",
"progress",
"otherwise",
"passes",
"on",
"transparently",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java#L146-L184 |
105,487 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java | ProxyFilter.filterWrite | @Override
public void filterWrite(final NextFilter nextFilter,
final IoSession session, final WriteRequest writeRequest) {
writeData(nextFilter, session, writeRequest, false);
} | java | @Override
public void filterWrite(final NextFilter nextFilter,
final IoSession session, final WriteRequest writeRequest) {
writeData(nextFilter, session, writeRequest, false);
} | [
"@",
"Override",
"public",
"void",
"filterWrite",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"IoSession",
"session",
",",
"final",
"WriteRequest",
"writeRequest",
")",
"{",
"writeData",
"(",
"nextFilter",
",",
"session",
",",
"writeRequest",
",",
"f... | Filters outgoing writes, queueing them up if necessary while a handshake
is ongoing.
@param nextFilter the next filter in filter chain
@param session the session object
@param writeRequest the data to write | [
"Filters",
"outgoing",
"writes",
"queueing",
"them",
"up",
"if",
"necessary",
"while",
"a",
"handshake",
"is",
"ongoing",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java#L194-L198 |
105,488 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java | ProxyFilter.writeData | public void writeData(final NextFilter nextFilter, final IoSession session,
final WriteRequest writeRequest, final boolean isHandshakeData) {
ProxyLogicHandler handler = getProxyHandler(session);
synchronized (handler) {
if (handler.isHandshakeComplete()) {
// Ha... | java | public void writeData(final NextFilter nextFilter, final IoSession session,
final WriteRequest writeRequest, final boolean isHandshakeData) {
ProxyLogicHandler handler = getProxyHandler(session);
synchronized (handler) {
if (handler.isHandshakeComplete()) {
// Ha... | [
"public",
"void",
"writeData",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"IoSession",
"session",
",",
"final",
"WriteRequest",
"writeRequest",
",",
"final",
"boolean",
"isHandshakeData",
")",
"{",
"ProxyLogicHandler",
"handler",
"=",
"getProxyHandler",
... | Actually write data. Queues the data up unless it relates to the handshake or the
handshake is done.
@param nextFilter the next filter in filter chain
@param session the session object
@param writeRequest the data to write
@param isHandshakeData true if writeRequest is written by the proxy classes. | [
"Actually",
"write",
"data",
".",
"Queues",
"the",
"data",
"up",
"unless",
"it",
"relates",
"to",
"the",
"handshake",
"or",
"the",
"handshake",
"is",
"done",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java#L209-L234 |
105,489 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java | ProxyFilter.messageSent | @Override
public void messageSent(final NextFilter nextFilter,
final IoSession session, final WriteRequest writeRequest)
throws Exception {
if (writeRequest.getMessage() != null
&& writeRequest.getMessage() instanceof ProxyHandshakeIoBuffer) {
// Ignore bu... | java | @Override
public void messageSent(final NextFilter nextFilter,
final IoSession session, final WriteRequest writeRequest)
throws Exception {
if (writeRequest.getMessage() != null
&& writeRequest.getMessage() instanceof ProxyHandshakeIoBuffer) {
// Ignore bu... | [
"@",
"Override",
"public",
"void",
"messageSent",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"IoSession",
"session",
",",
"final",
"WriteRequest",
"writeRequest",
")",
"throws",
"Exception",
"{",
"if",
"(",
"writeRequest",
".",
"getMessage",
"(",
")... | Filter handshake related messages from reaching the messageSent callbacks of
downstream filters.
@param nextFilter the next filter in filter chain
@param session the session object
@param writeRequest the data written | [
"Filter",
"handshake",
"related",
"messages",
"from",
"reaching",
"the",
"messageSent",
"callbacks",
"of",
"downstream",
"filters",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java#L244-L255 |
105,490 | kaazing/gateway | service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/codec/AmqpMessageDecoder.java | AmqpMessageDecoder.decodeAuthAmqPlain | private static String[] decodeAuthAmqPlain(String response) {
Logger logger = LoggerFactory.getLogger(SERVICE_AMQP_PROXY_LOGGER);
String[] credentials = null;
if ((response != null) && (response.trim().length() > 0)) {
ByteBuffer buffer = ByteBuffer.wrap(response.getBytes()... | java | private static String[] decodeAuthAmqPlain(String response) {
Logger logger = LoggerFactory.getLogger(SERVICE_AMQP_PROXY_LOGGER);
String[] credentials = null;
if ((response != null) && (response.trim().length() > 0)) {
ByteBuffer buffer = ByteBuffer.wrap(response.getBytes()... | [
"private",
"static",
"String",
"[",
"]",
"decodeAuthAmqPlain",
"(",
"String",
"response",
")",
"{",
"Logger",
"logger",
"=",
"LoggerFactory",
".",
"getLogger",
"(",
"SERVICE_AMQP_PROXY_LOGGER",
")",
";",
"String",
"[",
"]",
"credentials",
"=",
"null",
";",
"if... | the 1st element is the password. | [
"the",
"1st",
"element",
"is",
"the",
"password",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/amqp/src/main/java/org/kaazing/gateway/service/amqp/amqp091/codec/AmqpMessageDecoder.java#L309-L338 |
105,491 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/core/filterchain/DefaultIoFilterChain.java | DefaultIoFilterChain.checkOldName | private EntryImpl checkOldName(String baseName) {
EntryImpl e = (EntryImpl) name2entry.get(baseName);
if (e == null) {
throw new IllegalArgumentException("Filter not found:" + baseName);
}
return e;
} | java | private EntryImpl checkOldName(String baseName) {
EntryImpl e = (EntryImpl) name2entry.get(baseName);
if (e == null) {
throw new IllegalArgumentException("Filter not found:" + baseName);
}
return e;
} | [
"private",
"EntryImpl",
"checkOldName",
"(",
"String",
"baseName",
")",
"{",
"EntryImpl",
"e",
"=",
"(",
"EntryImpl",
")",
"name2entry",
".",
"get",
"(",
"baseName",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExceptio... | Throws an exception when the specified filter name is not registered in this chain.
@return An filter entry with the specified name. | [
"Throws",
"an",
"exception",
"when",
"the",
"specified",
"filter",
"name",
"is",
"not",
"registered",
"in",
"this",
"chain",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/filterchain/DefaultIoFilterChain.java#L328-L334 |
105,492 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/buffer/BufferedWriteFilter.java | BufferedWriteFilter.internalFlush | private void internalFlush(NextFilter nextFilter, IoSession session,
IoBuffer buf) throws Exception {
IoBuffer tmp;
synchronized (buf) {
buf.flip();
tmp = buf.duplicate();
buf.clear();
}
logger.debug("Flushing buffer: {}", tmp);
nex... | java | private void internalFlush(NextFilter nextFilter, IoSession session,
IoBuffer buf) throws Exception {
IoBuffer tmp;
synchronized (buf) {
buf.flip();
tmp = buf.duplicate();
buf.clear();
}
logger.debug("Flushing buffer: {}", tmp);
nex... | [
"private",
"void",
"internalFlush",
"(",
"NextFilter",
"nextFilter",
",",
"IoSession",
"session",
",",
"IoBuffer",
"buf",
")",
"throws",
"Exception",
"{",
"IoBuffer",
"tmp",
";",
"synchronized",
"(",
"buf",
")",
"{",
"buf",
".",
"flip",
"(",
")",
";",
"tmp... | Internal method that actually flushes the buffered data.
@param nextFilter the {@link NextFilter} of this filter
@param session the session where buffer will be written
@param buf the data to write
@throws Exception if a write operation fails | [
"Internal",
"method",
"that",
"actually",
"flushes",
"the",
"buffered",
"data",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/buffer/BufferedWriteFilter.java#L195-L205 |
105,493 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/buffer/BufferedWriteFilter.java | BufferedWriteFilter.flush | public void flush(IoSession session) {
try {
internalFlush(session.getFilterChain().getNextFilter(this),
session, buffersMap.get(session));
} catch (Throwable e) {
session.getFilterChain().fireExceptionCaught(e);
}
} | java | public void flush(IoSession session) {
try {
internalFlush(session.getFilterChain().getNextFilter(this),
session, buffersMap.get(session));
} catch (Throwable e) {
session.getFilterChain().fireExceptionCaught(e);
}
} | [
"public",
"void",
"flush",
"(",
"IoSession",
"session",
")",
"{",
"try",
"{",
"internalFlush",
"(",
"session",
".",
"getFilterChain",
"(",
")",
".",
"getNextFilter",
"(",
"this",
")",
",",
"session",
",",
"buffersMap",
".",
"get",
"(",
"session",
")",
")... | Flushes the buffered data.
@param session the session where buffer will be written | [
"Flushes",
"the",
"buffered",
"data",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/buffer/BufferedWriteFilter.java#L212-L219 |
105,494 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java | VicariousThreadLocal.currentThreadRef | static WeakReference<Thread> currentThreadRef() {
WeakReference<Thread> ref = weakThread.get();
if (ref == null) {
ref = new WeakReference<>(Thread.currentThread());
weakThread.set(ref);
}
return ref;
} | java | static WeakReference<Thread> currentThreadRef() {
WeakReference<Thread> ref = weakThread.get();
if (ref == null) {
ref = new WeakReference<>(Thread.currentThread());
weakThread.set(ref);
}
return ref;
} | [
"static",
"WeakReference",
"<",
"Thread",
">",
"currentThreadRef",
"(",
")",
"{",
"WeakReference",
"<",
"Thread",
">",
"ref",
"=",
"weakThread",
".",
"get",
"(",
")",
";",
"if",
"(",
"ref",
"==",
"null",
")",
"{",
"ref",
"=",
"new",
"WeakReference",
"<... | Returns a unique object representing the current thread. Although we use a weak-reference to the thread, we could
use practically anything that does not reference our class-loader. | [
"Returns",
"a",
"unique",
"object",
"representing",
"the",
"current",
"thread",
".",
"Although",
"we",
"use",
"a",
"weak",
"-",
"reference",
"to",
"the",
"thread",
"we",
"could",
"use",
"practically",
"anything",
"that",
"does",
"not",
"reference",
"our",
"c... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java#L67-L74 |
105,495 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java | VicariousThreadLocal.createHolder | private Holder createHolder() {
poll();
Holder holder = new Holder(queue);
WeakReference<Holder> ref = new WeakReference<>(holder);
Holder old;
do {
old = strongRefs;
holder.next = old;
} while (!strongRefsUpdater.compareAndSet(this, old, holder))... | java | private Holder createHolder() {
poll();
Holder holder = new Holder(queue);
WeakReference<Holder> ref = new WeakReference<>(holder);
Holder old;
do {
old = strongRefs;
holder.next = old;
} while (!strongRefsUpdater.compareAndSet(this, old, holder))... | [
"private",
"Holder",
"createHolder",
"(",
")",
"{",
"poll",
"(",
")",
";",
"Holder",
"holder",
"=",
"new",
"Holder",
"(",
"queue",
")",
";",
"WeakReference",
"<",
"Holder",
">",
"ref",
"=",
"new",
"WeakReference",
"<>",
"(",
"holder",
")",
";",
"Holder... | Creates a new holder object, and registers it appropriately. Also polls for thread-exits. | [
"Creates",
"a",
"new",
"holder",
"object",
"and",
"registers",
"it",
"appropriately",
".",
"Also",
"polls",
"for",
"thread",
"-",
"exits",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java#L176-L189 |
105,496 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java | VicariousThreadLocal.isInitialized | public boolean isInitialized() {
WeakReference<Holder> ref = local.get();
if (ref != null) {
Holder holder = ref.get();
return holder != null && holder.value != UNINITIALISED;
} else {
return false;
}
} | java | public boolean isInitialized() {
WeakReference<Holder> ref = local.get();
if (ref != null) {
Holder holder = ref.get();
return holder != null && holder.value != UNINITIALISED;
} else {
return false;
}
} | [
"public",
"boolean",
"isInitialized",
"(",
")",
"{",
"WeakReference",
"<",
"Holder",
">",
"ref",
"=",
"local",
".",
"get",
"(",
")",
";",
"if",
"(",
"ref",
"!=",
"null",
")",
"{",
"Holder",
"holder",
"=",
"ref",
".",
"get",
"(",
")",
";",
"return",... | Indicates whether thread-local has been initialised for the current thread. | [
"Indicates",
"whether",
"thread",
"-",
"local",
"has",
"been",
"initialised",
"for",
"the",
"current",
"thread",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java#L202-L210 |
105,497 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java | VicariousThreadLocal.swap | @SuppressWarnings("unchecked")
public T swap(T value) {
final Holder holder;
final T oldValue;
WeakReference<Holder> ref = local.get();
if (ref != null) {
holder = ref.get();
Object holderValue = holder.value;
if (holderValue != UNINITIALISED) {
... | java | @SuppressWarnings("unchecked")
public T swap(T value) {
final Holder holder;
final T oldValue;
WeakReference<Holder> ref = local.get();
if (ref != null) {
holder = ref.get();
Object holderValue = holder.value;
if (holderValue != UNINITIALISED) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"swap",
"(",
"T",
"value",
")",
"{",
"final",
"Holder",
"holder",
";",
"final",
"T",
"oldValue",
";",
"WeakReference",
"<",
"Holder",
">",
"ref",
"=",
"local",
".",
"get",
"(",
")",
";"... | Swaps the current threads value with the supplied value. Thread-local will be initialised if not already done so. | [
"Swaps",
"the",
"current",
"threads",
"value",
"with",
"the",
"supplied",
"value",
".",
"Thread",
"-",
"local",
"will",
"be",
"initialised",
"if",
"not",
"already",
"done",
"so",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java#L215-L234 |
105,498 | kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java | VicariousThreadLocal.poll | public void poll() {
synchronized (queue) {
// Remove queued references.
// (Is this better inside or out?)
if (queue.poll() == null) {
// Nothing to do.
return;
}
while (queue.poll() != null) {
// Discar... | java | public void poll() {
synchronized (queue) {
// Remove queued references.
// (Is this better inside or out?)
if (queue.poll() == null) {
// Nothing to do.
return;
}
while (queue.poll() != null) {
// Discar... | [
"public",
"void",
"poll",
"(",
")",
"{",
"synchronized",
"(",
"queue",
")",
"{",
"// Remove queued references.",
"// (Is this better inside or out?)",
"if",
"(",
"queue",
".",
"poll",
"(",
")",
"==",
"null",
")",
"{",
"// Nothing to do.",
"return",
";",
"}",
"... | Check if any strong references need should be removed due to thread exit. | [
"Check",
"if",
"any",
"strong",
"references",
"need",
"should",
"be",
"removed",
"due",
"to",
"thread",
"exit",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java#L274-L313 |
105,499 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpProxyRequest.java | HttpProxyRequest.getHost | public synchronized final String getHost() {
if (host == null) {
if (getEndpointAddress() != null &&
!getEndpointAddress().isUnresolved()) {
host = getEndpointAddress().getHostName();
}
if (host == null && httpURI != null) {
... | java | public synchronized final String getHost() {
if (host == null) {
if (getEndpointAddress() != null &&
!getEndpointAddress().isUnresolved()) {
host = getEndpointAddress().getHostName();
}
if (host == null && httpURI != null) {
... | [
"public",
"synchronized",
"final",
"String",
"getHost",
"(",
")",
"{",
"if",
"(",
"host",
"==",
"null",
")",
"{",
"if",
"(",
"getEndpointAddress",
"(",
")",
"!=",
"null",
"&&",
"!",
"getEndpointAddress",
"(",
")",
".",
"isUnresolved",
"(",
")",
")",
"{... | Returns the host to which we are connecting. | [
"Returns",
"the",
"host",
"to",
"which",
"we",
"are",
"connecting",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/HttpProxyRequest.java#L193-L210 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.