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
sequence
docstring
stringlengths
3
16k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java
Launcher.createLaunchArguments
private LaunchArguments createLaunchArguments(String[] args, Map<String, String> initProps) { List<String> cmdArgs = processBatchFileArgs(new ArrayList<String>(Arrays.asList(args))); return new LaunchArguments(cmdArgs, initProps, isClient()); }
java
private LaunchArguments createLaunchArguments(String[] args, Map<String, String> initProps) { List<String> cmdArgs = processBatchFileArgs(new ArrayList<String>(Arrays.asList(args))); return new LaunchArguments(cmdArgs, initProps, isClient()); }
[ "private", "LaunchArguments", "createLaunchArguments", "(", "String", "[", "]", "args", ",", "Map", "<", "String", ",", "String", ">", "initProps", ")", "{", "List", "<", "String", ">", "cmdArgs", "=", "processBatchFileArgs", "(", "new", "ArrayList", "<", "String", ">", "(", "Arrays", ".", "asList", "(", "args", ")", ")", ")", ";", "return", "new", "LaunchArguments", "(", "cmdArgs", ",", "initProps", ",", "isClient", "(", ")", ")", ";", "}" ]
Return an instance of LaunchArguments. @return LaunchArguments
[ "Return", "an", "instance", "of", "LaunchArguments", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java#L221-L224
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java
Launcher.handleActions
protected ReturnCode handleActions(BootstrapConfig bootProps, LaunchArguments launchArgs) { ReturnCode rc = launchArgs.getRc(); switch (rc) { case OK: rc = new KernelBootstrap(bootProps).go(); break; case CREATE_ACTION: // Use initialized bootstrap configuration to create the server lock. // This ensures the server and nested workarea directory exist and are writable ServerLock.createServerLock(bootProps); boolean generatePass = launchArgs.getOption("no-password") == null; rc = bootProps.generateServerEnv(generatePass); break; case MESSAGE_ACTION: rc = showMessage(launchArgs); break; case HELP_ACTION: rc = showHelp(launchArgs); break; case VERSION_ACTION: KernelBootstrap.showVersion(bootProps); rc = ReturnCode.OK; break; case STOP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).stop(); break; case STATUS_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).status(false); break; case STARTING_STATUS_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).status(true); break; case START_STATUS_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).startStatus(); break; case PACKAGE_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.PackageCommand(bootProps, launchArgs).doPackage(); break; case PACKAGE_WLP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.PackageCommand(bootProps, launchArgs).doPackageRuntimeOnly(); break; case DUMP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).dump(); break; case JAVADUMP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).dumpJava(); break; case PAUSE_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).pause(); break; case RESUME_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).resume(); break; case LIST_ACTION: rc = new ListServerHelper(bootProps, launchArgs).listServers(); break; default: showHelp(launchArgs); rc = ReturnCode.BAD_ARGUMENT; } return rc; }
java
protected ReturnCode handleActions(BootstrapConfig bootProps, LaunchArguments launchArgs) { ReturnCode rc = launchArgs.getRc(); switch (rc) { case OK: rc = new KernelBootstrap(bootProps).go(); break; case CREATE_ACTION: // Use initialized bootstrap configuration to create the server lock. // This ensures the server and nested workarea directory exist and are writable ServerLock.createServerLock(bootProps); boolean generatePass = launchArgs.getOption("no-password") == null; rc = bootProps.generateServerEnv(generatePass); break; case MESSAGE_ACTION: rc = showMessage(launchArgs); break; case HELP_ACTION: rc = showHelp(launchArgs); break; case VERSION_ACTION: KernelBootstrap.showVersion(bootProps); rc = ReturnCode.OK; break; case STOP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).stop(); break; case STATUS_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).status(false); break; case STARTING_STATUS_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).status(true); break; case START_STATUS_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).startStatus(); break; case PACKAGE_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.PackageCommand(bootProps, launchArgs).doPackage(); break; case PACKAGE_WLP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.PackageCommand(bootProps, launchArgs).doPackageRuntimeOnly(); break; case DUMP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).dump(); break; case JAVADUMP_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).dumpJava(); break; case PAUSE_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).pause(); break; case RESUME_ACTION: rc = new com.ibm.ws.kernel.boot.internal.commands.ProcessControlHelper(bootProps, launchArgs).resume(); break; case LIST_ACTION: rc = new ListServerHelper(bootProps, launchArgs).listServers(); break; default: showHelp(launchArgs); rc = ReturnCode.BAD_ARGUMENT; } return rc; }
[ "protected", "ReturnCode", "handleActions", "(", "BootstrapConfig", "bootProps", ",", "LaunchArguments", "launchArgs", ")", "{", "ReturnCode", "rc", "=", "launchArgs", ".", "getRc", "(", ")", ";", "switch", "(", "rc", ")", "{", "case", "OK", ":", "rc", "=", "new", "KernelBootstrap", "(", "bootProps", ")", ".", "go", "(", ")", ";", "break", ";", "case", "CREATE_ACTION", ":", "// Use initialized bootstrap configuration to create the server lock.", "// This ensures the server and nested workarea directory exist and are writable", "ServerLock", ".", "createServerLock", "(", "bootProps", ")", ";", "boolean", "generatePass", "=", "launchArgs", ".", "getOption", "(", "\"no-password\"", ")", "==", "null", ";", "rc", "=", "bootProps", ".", "generateServerEnv", "(", "generatePass", ")", ";", "break", ";", "case", "MESSAGE_ACTION", ":", "rc", "=", "showMessage", "(", "launchArgs", ")", ";", "break", ";", "case", "HELP_ACTION", ":", "rc", "=", "showHelp", "(", "launchArgs", ")", ";", "break", ";", "case", "VERSION_ACTION", ":", "KernelBootstrap", ".", "showVersion", "(", "bootProps", ")", ";", "rc", "=", "ReturnCode", ".", "OK", ";", "break", ";", "case", "STOP_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "stop", "(", ")", ";", "break", ";", "case", "STATUS_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "status", "(", "false", ")", ";", "break", ";", "case", "STARTING_STATUS_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "status", "(", "true", ")", ";", "break", ";", "case", "START_STATUS_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "startStatus", "(", ")", ";", "break", ";", "case", "PACKAGE_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "PackageCommand", "(", "bootProps", ",", "launchArgs", ")", ".", "doPackage", "(", ")", ";", "break", ";", "case", "PACKAGE_WLP_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "PackageCommand", "(", "bootProps", ",", "launchArgs", ")", ".", "doPackageRuntimeOnly", "(", ")", ";", "break", ";", "case", "DUMP_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "dump", "(", ")", ";", "break", ";", "case", "JAVADUMP_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "dumpJava", "(", ")", ";", "break", ";", "case", "PAUSE_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "pause", "(", ")", ";", "break", ";", "case", "RESUME_ACTION", ":", "rc", "=", "new", "com", ".", "ibm", ".", "ws", ".", "kernel", ".", "boot", ".", "internal", ".", "commands", ".", "ProcessControlHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "resume", "(", ")", ";", "break", ";", "case", "LIST_ACTION", ":", "rc", "=", "new", "ListServerHelper", "(", "bootProps", ",", "launchArgs", ")", ".", "listServers", "(", ")", ";", "break", ";", "default", ":", "showHelp", "(", "launchArgs", ")", ";", "rc", "=", "ReturnCode", ".", "BAD_ARGUMENT", ";", "}", "return", "rc", ";", "}" ]
Handle the process action. @param bootProps An instance of BootstrapConfig @param launchArgs An instance of LaunchArguments
[ "Handle", "the", "process", "action", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java#L236-L299
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java
Launcher.findLocations
protected void findLocations(BootstrapConfig bootProps, String processName) { // Check for environment variables... String userDirStr = getEnv(BootstrapConstants.ENV_WLP_USER_DIR); String serversDirStr = getEnv(bootProps.getOutputDirectoryEnvName()); // Check for the variable calculated by the shell script first (X_LOG_DIR) // If that wasn't found, check for LOG_DIR set for java -jar invocation String logDirStr = getEnv(BootstrapConstants.ENV_X_LOG_DIR); if (logDirStr == null) logDirStr = getEnv(BootstrapConstants.ENV_LOG_DIR); // Likewise for X_LOG_FILE and LOG_FILE. String consoleLogFileStr = getEnv(BootstrapConstants.ENV_X_LOG_FILE); if (consoleLogFileStr == null) consoleLogFileStr = getEnv(BootstrapConstants.ENV_LOG_FILE); // Do enough processing to know where the directories should be.. // this should not cause any directories to be created bootProps.findLocations(processName, userDirStr, serversDirStr, logDirStr, consoleLogFileStr); }
java
protected void findLocations(BootstrapConfig bootProps, String processName) { // Check for environment variables... String userDirStr = getEnv(BootstrapConstants.ENV_WLP_USER_DIR); String serversDirStr = getEnv(bootProps.getOutputDirectoryEnvName()); // Check for the variable calculated by the shell script first (X_LOG_DIR) // If that wasn't found, check for LOG_DIR set for java -jar invocation String logDirStr = getEnv(BootstrapConstants.ENV_X_LOG_DIR); if (logDirStr == null) logDirStr = getEnv(BootstrapConstants.ENV_LOG_DIR); // Likewise for X_LOG_FILE and LOG_FILE. String consoleLogFileStr = getEnv(BootstrapConstants.ENV_X_LOG_FILE); if (consoleLogFileStr == null) consoleLogFileStr = getEnv(BootstrapConstants.ENV_LOG_FILE); // Do enough processing to know where the directories should be.. // this should not cause any directories to be created bootProps.findLocations(processName, userDirStr, serversDirStr, logDirStr, consoleLogFileStr); }
[ "protected", "void", "findLocations", "(", "BootstrapConfig", "bootProps", ",", "String", "processName", ")", "{", "// Check for environment variables...", "String", "userDirStr", "=", "getEnv", "(", "BootstrapConstants", ".", "ENV_WLP_USER_DIR", ")", ";", "String", "serversDirStr", "=", "getEnv", "(", "bootProps", ".", "getOutputDirectoryEnvName", "(", ")", ")", ";", "// Check for the variable calculated by the shell script first (X_LOG_DIR)", "// If that wasn't found, check for LOG_DIR set for java -jar invocation", "String", "logDirStr", "=", "getEnv", "(", "BootstrapConstants", ".", "ENV_X_LOG_DIR", ")", ";", "if", "(", "logDirStr", "==", "null", ")", "logDirStr", "=", "getEnv", "(", "BootstrapConstants", ".", "ENV_LOG_DIR", ")", ";", "// Likewise for X_LOG_FILE and LOG_FILE.", "String", "consoleLogFileStr", "=", "getEnv", "(", "BootstrapConstants", ".", "ENV_X_LOG_FILE", ")", ";", "if", "(", "consoleLogFileStr", "==", "null", ")", "consoleLogFileStr", "=", "getEnv", "(", "BootstrapConstants", ".", "ENV_LOG_FILE", ")", ";", "// Do enough processing to know where the directories should be..", "// this should not cause any directories to be created", "bootProps", ".", "findLocations", "(", "processName", ",", "userDirStr", ",", "serversDirStr", ",", "logDirStr", ",", "consoleLogFileStr", ")", ";", "}" ]
Find main locations @param bootProps An instance of BootstrapConfig @param processName Process name to be used
[ "Find", "main", "locations" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/Launcher.java#L307-L326
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MPConnection.java
MPConnection.send
void send(AbstractMessage aMessage, int priority) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "send", new Object[] {this, aMessage, new Integer(priority), "verboseMsg OUT : " + aMessage.toVerboseString()}); if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) MPIOMsgDebug.debug(tc, aMessage, priority); // comms accepting messages, write the message // immediately. try { //send the encoded message connection.send(aMessage, priority); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message accepted by Comms"); } catch (SIConnectionDroppedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Connection Dropped"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch (SIConnectionUnavailableException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Connection Unavailable"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch (SIConnectionLostException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Connection Lost"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(MessageEncodeFailedException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Msg Encode Failed"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(MessageCopyFailedException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Msg Copy Failed"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(UnsupportedEncodingException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Msg Encoding Failed"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(IncorrectMessageTypeException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Incorrect Message Type"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "send"); }
java
void send(AbstractMessage aMessage, int priority) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "send", new Object[] {this, aMessage, new Integer(priority), "verboseMsg OUT : " + aMessage.toVerboseString()}); if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) MPIOMsgDebug.debug(tc, aMessage, priority); // comms accepting messages, write the message // immediately. try { //send the encoded message connection.send(aMessage, priority); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message accepted by Comms"); } catch (SIConnectionDroppedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Connection Dropped"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch (SIConnectionUnavailableException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Connection Unavailable"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch (SIConnectionLostException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Connection Lost"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(MessageEncodeFailedException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Msg Encode Failed"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(MessageCopyFailedException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Msg Copy Failed"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(UnsupportedEncodingException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Msg Encoding Failed"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } catch(IncorrectMessageTypeException e) { // No FFDC code needed //this should never happen, but comms declare the exception, so //we have to deal with it if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "send", "Message refused by Comms: Incorrect Message Type"); // Pass this exception up to our parent. Note that we'll assume // we're still alive, and let our parent (in coordination with TRM // decide whether or not to nuke us). mpio.error(connection, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "send"); }
[ "void", "send", "(", "AbstractMessage", "aMessage", ",", "int", "priority", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"send\"", ",", "new", "Object", "[", "]", "{", "this", ",", "aMessage", ",", "new", "Integer", "(", "priority", ")", ",", "\"verboseMsg OUT : \"", "+", "aMessage", ".", "toVerboseString", "(", ")", "}", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "MPIOMsgDebug", ".", "debug", "(", "tc", ",", "aMessage", ",", "priority", ")", ";", "// comms accepting messages, write the message", "// immediately.", "try", "{", "//send the encoded message", "connection", ".", "send", "(", "aMessage", ",", "priority", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message accepted by Comms\"", ")", ";", "}", "catch", "(", "SIConnectionDroppedException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message refused by Comms: Connection Dropped\"", ")", ";", "// Pass this exception up to our parent. Note that we'll assume", "// we're still alive, and let our parent (in coordination with TRM", "// decide whether or not to nuke us).", "mpio", ".", "error", "(", "connection", ",", "e", ")", ";", "}", "catch", "(", "SIConnectionUnavailableException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message refused by Comms: Connection Unavailable\"", ")", ";", "// Pass this exception up to our parent. Note that we'll assume", "// we're still alive, and let our parent (in coordination with TRM", "// decide whether or not to nuke us).", "mpio", ".", "error", "(", "connection", ",", "e", ")", ";", "}", "catch", "(", "SIConnectionLostException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message refused by Comms: Connection Lost\"", ")", ";", "// Pass this exception up to our parent. Note that we'll assume", "// we're still alive, and let our parent (in coordination with TRM", "// decide whether or not to nuke us).", "mpio", ".", "error", "(", "connection", ",", "e", ")", ";", "}", "catch", "(", "MessageEncodeFailedException", "e", ")", "{", "// No FFDC code needed", "//this should never happen, but comms declare the exception, so", "//we have to deal with it", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message refused by Comms: Msg Encode Failed\"", ")", ";", "// Pass this exception up to our parent. Note that we'll assume", "// we're still alive, and let our parent (in coordination with TRM", "// decide whether or not to nuke us).", "mpio", ".", "error", "(", "connection", ",", "e", ")", ";", "}", "catch", "(", "MessageCopyFailedException", "e", ")", "{", "// No FFDC code needed", "//this should never happen, but comms declare the exception, so", "//we have to deal with it", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message refused by Comms: Msg Copy Failed\"", ")", ";", "// Pass this exception up to our parent. Note that we'll assume", "// we're still alive, and let our parent (in coordination with TRM", "// decide whether or not to nuke us).", "mpio", ".", "error", "(", "connection", ",", "e", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "// No FFDC code needed", "//this should never happen, but comms declare the exception, so", "//we have to deal with it", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message refused by Comms: Msg Encoding Failed\"", ")", ";", "// Pass this exception up to our parent. Note that we'll assume", "// we're still alive, and let our parent (in coordination with TRM", "// decide whether or not to nuke us).", "mpio", ".", "error", "(", "connection", ",", "e", ")", ";", "}", "catch", "(", "IncorrectMessageTypeException", "e", ")", "{", "// No FFDC code needed", "//this should never happen, but comms declare the exception, so", "//we have to deal with it", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"send\"", ",", "\"Message refused by Comms: Incorrect Message Type\"", ")", ";", "// Pass this exception up to our parent. Note that we'll assume", "// we're still alive, and let our parent (in coordination with TRM", "// decide whether or not to nuke us).", "mpio", ".", "error", "(", "connection", ",", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"send\"", ")", ";", "}" ]
If comms has capacity, then send the encoded message data. Otherwise, throw the message away. @param messageData The encoded message data @param priority the priority at which to send the message @param isControl true if the message is a control message
[ "If", "comms", "has", "capacity", "then", "send", "the", "encoded", "message", "data", ".", "Otherwise", "throw", "the", "message", "away", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MPConnection.java#L77-L186
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MPConnection.java
MPConnection.getVersion
public ProtocolVersion getVersion() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getVersion"); // The ProtocolVersion to be returned ProtocolVersion version = ProtocolVersion.UNKNOWN; // Get the MetaData out of the connection ConnectionMetaData connMetaData = connection.getMetaData(); // If the MetaData is non-null we can retrieve a version. if(connMetaData != null) version = connMetaData.getProtocolVersion(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getVersion", version); return version; }
java
public ProtocolVersion getVersion() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getVersion"); // The ProtocolVersion to be returned ProtocolVersion version = ProtocolVersion.UNKNOWN; // Get the MetaData out of the connection ConnectionMetaData connMetaData = connection.getMetaData(); // If the MetaData is non-null we can retrieve a version. if(connMetaData != null) version = connMetaData.getProtocolVersion(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getVersion", version); return version; }
[ "public", "ProtocolVersion", "getVersion", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"getVersion\"", ")", ";", "// The ProtocolVersion to be returned", "ProtocolVersion", "version", "=", "ProtocolVersion", ".", "UNKNOWN", ";", "// Get the MetaData out of the connection", "ConnectionMetaData", "connMetaData", "=", "connection", ".", "getMetaData", "(", ")", ";", "// If the MetaData is non-null we can retrieve a version.", "if", "(", "connMetaData", "!=", "null", ")", "version", "=", "connMetaData", ".", "getProtocolVersion", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"getVersion\"", ",", "version", ")", ";", "return", "version", ";", "}" ]
Retrieve the ProtocolVersion associated with this connection. @return the version of the connection protocol.
[ "Retrieve", "the", "ProtocolVersion", "associated", "with", "this", "connection", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/io/MPConnection.java#L219-L237
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.ejb/src/com/ibm/ws/jaxws/ejb/EJBMethodInvoker.java
EJBMethodInvoker.performInvocation
@Override protected Object performInvocation(Exchange exchange, final Object serviceObject, Method m, Object[] paramArray) throws Exception { // This retrieves the appropriate method from the wrapper class m = serviceObject.getClass().getMethod(m.getName(), m.getParameterTypes()); return super.performInvocation(exchange, serviceObject, m, paramArray); }
java
@Override protected Object performInvocation(Exchange exchange, final Object serviceObject, Method m, Object[] paramArray) throws Exception { // This retrieves the appropriate method from the wrapper class m = serviceObject.getClass().getMethod(m.getName(), m.getParameterTypes()); return super.performInvocation(exchange, serviceObject, m, paramArray); }
[ "@", "Override", "protected", "Object", "performInvocation", "(", "Exchange", "exchange", ",", "final", "Object", "serviceObject", ",", "Method", "m", ",", "Object", "[", "]", "paramArray", ")", "throws", "Exception", "{", "// This retrieves the appropriate method from the wrapper class", "m", "=", "serviceObject", ".", "getClass", "(", ")", ".", "getMethod", "(", "m", ".", "getName", "(", ")", ",", "m", ".", "getParameterTypes", "(", ")", ")", ";", "return", "super", ".", "performInvocation", "(", "exchange", ",", "serviceObject", ",", "m", ",", "paramArray", ")", ";", "}" ]
This invokes the target operation. We override this method to deal with the fact that the 'serviceObject' is actually an EJB wrapper class. We need to get an equivalent method on the 'serviceObject' class in order to invoke the target operation.
[ "This", "invokes", "the", "target", "operation", ".", "We", "override", "this", "method", "to", "deal", "with", "the", "fact", "that", "the", "serviceObject", "is", "actually", "an", "EJB", "wrapper", "class", ".", "We", "need", "to", "get", "an", "equivalent", "method", "on", "the", "serviceObject", "class", "in", "order", "to", "invoke", "the", "target", "operation", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.ejb/src/com/ibm/ws/jaxws/ejb/EJBMethodInvoker.java#L100-L106
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.authorization.builtin/src/com/ibm/ws/security/authorization/builtin/AbstractSecurityAuthorizationTable.java
AbstractSecurityAuthorizationTable.getUserAccessId
private String getUserAccessId(String userName) { try { SecurityService securityService = securityServiceRef.getService(); UserRegistryService userRegistryService = securityService.getUserRegistryService(); UserRegistry userRegistry = userRegistryService.getUserRegistry(); String realm = userRegistry.getRealm(); String uniqueId = userRegistry.getUniqueUserId(userName); return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_USER, realm, uniqueId); } catch (EntryNotFoundException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + userName + ": " + e); } } catch (RegistryException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + userName + ": " + e); } } return null; }
java
private String getUserAccessId(String userName) { try { SecurityService securityService = securityServiceRef.getService(); UserRegistryService userRegistryService = securityService.getUserRegistryService(); UserRegistry userRegistry = userRegistryService.getUserRegistry(); String realm = userRegistry.getRealm(); String uniqueId = userRegistry.getUniqueUserId(userName); return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_USER, realm, uniqueId); } catch (EntryNotFoundException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + userName + ": " + e); } } catch (RegistryException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + userName + ": " + e); } } return null; }
[ "private", "String", "getUserAccessId", "(", "String", "userName", ")", "{", "try", "{", "SecurityService", "securityService", "=", "securityServiceRef", ".", "getService", "(", ")", ";", "UserRegistryService", "userRegistryService", "=", "securityService", ".", "getUserRegistryService", "(", ")", ";", "UserRegistry", "userRegistry", "=", "userRegistryService", ".", "getUserRegistry", "(", ")", ";", "String", "realm", "=", "userRegistry", ".", "getRealm", "(", ")", ";", "String", "uniqueId", "=", "userRegistry", ".", "getUniqueUserId", "(", "userName", ")", ";", "return", "AccessIdUtil", ".", "createAccessId", "(", "AccessIdUtil", ".", "TYPE_USER", ",", "realm", ",", "uniqueId", ")", ";", "}", "catch", "(", "EntryNotFoundException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Caught exception getting the access id for \"", "+", "userName", "+", "\": \"", "+", "e", ")", ";", "}", "}", "catch", "(", "RegistryException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Caught exception getting the access id for \"", "+", "userName", "+", "\": \"", "+", "e", ")", ";", "}", "}", "return", "null", ";", "}" ]
Get the access id for a user by performing a looking up in the user registry. @param userName the user for which to create an access id @return the access id of the userName specified, otherwise null when a registry error occurs or the entry is not found
[ "Get", "the", "access", "id", "for", "a", "user", "by", "performing", "a", "looking", "up", "in", "the", "user", "registry", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authorization.builtin/src/com/ibm/ws/security/authorization/builtin/AbstractSecurityAuthorizationTable.java#L317-L338
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.authorization.builtin/src/com/ibm/ws/security/authorization/builtin/AbstractSecurityAuthorizationTable.java
AbstractSecurityAuthorizationTable.getGroupAccessId
private String getGroupAccessId(String groupName) { try { SecurityService securityService = securityServiceRef.getService(); UserRegistryService userRegistryService = securityService.getUserRegistryService(); UserRegistry userRegistry = userRegistryService.getUserRegistry(); String realm = userRegistry.getRealm(); String groupUniqueId = userRegistry.getUniqueGroupId(groupName); return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_GROUP, realm, groupUniqueId); } catch (EntryNotFoundException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + groupName + ": " + e); } } catch (RegistryException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + groupName + ": " + e); } } return null; }
java
private String getGroupAccessId(String groupName) { try { SecurityService securityService = securityServiceRef.getService(); UserRegistryService userRegistryService = securityService.getUserRegistryService(); UserRegistry userRegistry = userRegistryService.getUserRegistry(); String realm = userRegistry.getRealm(); String groupUniqueId = userRegistry.getUniqueGroupId(groupName); return AccessIdUtil.createAccessId(AccessIdUtil.TYPE_GROUP, realm, groupUniqueId); } catch (EntryNotFoundException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + groupName + ": " + e); } } catch (RegistryException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception getting the access id for " + groupName + ": " + e); } } return null; }
[ "private", "String", "getGroupAccessId", "(", "String", "groupName", ")", "{", "try", "{", "SecurityService", "securityService", "=", "securityServiceRef", ".", "getService", "(", ")", ";", "UserRegistryService", "userRegistryService", "=", "securityService", ".", "getUserRegistryService", "(", ")", ";", "UserRegistry", "userRegistry", "=", "userRegistryService", ".", "getUserRegistry", "(", ")", ";", "String", "realm", "=", "userRegistry", ".", "getRealm", "(", ")", ";", "String", "groupUniqueId", "=", "userRegistry", ".", "getUniqueGroupId", "(", "groupName", ")", ";", "return", "AccessIdUtil", ".", "createAccessId", "(", "AccessIdUtil", ".", "TYPE_GROUP", ",", "realm", ",", "groupUniqueId", ")", ";", "}", "catch", "(", "EntryNotFoundException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Caught exception getting the access id for \"", "+", "groupName", "+", "\": \"", "+", "e", ")", ";", "}", "}", "catch", "(", "RegistryException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Caught exception getting the access id for \"", "+", "groupName", "+", "\": \"", "+", "e", ")", ";", "}", "}", "return", "null", ";", "}" ]
Get the access id for a group by performing a looking up in the user registry. @param groupName the user for which to create an access id @return the access id of the groupName specified, otherwise null when a registry error occurs or the entry is not found
[ "Get", "the", "access", "id", "for", "a", "group", "by", "performing", "a", "looking", "up", "in", "the", "user", "registry", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authorization.builtin/src/com/ibm/ws/security/authorization/builtin/AbstractSecurityAuthorizationTable.java#L347-L367
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
HtmlResponseStateManager.getSavedState
private Object getSavedState(FacesContext facesContext) { Object encodedState = facesContext.getExternalContext().getRequestParameterMap().get(STANDARD_STATE_SAVING_PARAM); if(encodedState==null || (((String) encodedState).length() == 0)) { return null; } Object savedStateObject = _stateTokenProcessor.decode(facesContext, (String)encodedState); return savedStateObject; }
java
private Object getSavedState(FacesContext facesContext) { Object encodedState = facesContext.getExternalContext().getRequestParameterMap().get(STANDARD_STATE_SAVING_PARAM); if(encodedState==null || (((String) encodedState).length() == 0)) { return null; } Object savedStateObject = _stateTokenProcessor.decode(facesContext, (String)encodedState); return savedStateObject; }
[ "private", "Object", "getSavedState", "(", "FacesContext", "facesContext", ")", "{", "Object", "encodedState", "=", "facesContext", ".", "getExternalContext", "(", ")", ".", "getRequestParameterMap", "(", ")", ".", "get", "(", "STANDARD_STATE_SAVING_PARAM", ")", ";", "if", "(", "encodedState", "==", "null", "||", "(", "(", "(", "String", ")", "encodedState", ")", ".", "length", "(", ")", "==", "0", ")", ")", "{", "return", "null", ";", "}", "Object", "savedStateObject", "=", "_stateTokenProcessor", ".", "decode", "(", "facesContext", ",", "(", "String", ")", "encodedState", ")", ";", "return", "savedStateObject", ";", "}" ]
Reconstructs the state from the "javax.faces.ViewState" request parameter. @param facesContext the current FacesContext @return the reconstructed state, or <code>null</code> if there was no saved state
[ "Reconstructs", "the", "state", "from", "the", "javax", ".", "faces", ".", "ViewState", "request", "parameter", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java#L203-L215
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
HtmlResponseStateManager.isPostback
@Override public boolean isPostback(FacesContext context) { return context.getExternalContext().getRequestParameterMap().containsKey(ResponseStateManager.VIEW_STATE_PARAM); }
java
@Override public boolean isPostback(FacesContext context) { return context.getExternalContext().getRequestParameterMap().containsKey(ResponseStateManager.VIEW_STATE_PARAM); }
[ "@", "Override", "public", "boolean", "isPostback", "(", "FacesContext", "context", ")", "{", "return", "context", ".", "getExternalContext", "(", ")", ".", "getRequestParameterMap", "(", ")", ".", "containsKey", "(", "ResponseStateManager", ".", "VIEW_STATE_PARAM", ")", ";", "}" ]
Checks if the current request is a postback @since 1.2
[ "Checks", "if", "the", "current", "request", "is", "a", "postback" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java#L222-L226
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java
MatchSpaceImpl.initialise
public void initialise(Identifier rootId, boolean enableCache) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry(cclass, "initialise", new Object[] {rootId, new Boolean(enableCache)}); switch (rootId.getType()) { case Selector.UNKNOWN : case Selector.OBJECT : matchTree = new EqualityMatcher(rootId); break; case Selector.STRING : case Selector.TOPIC : matchTree = new StringMatcher(rootId); break; case Selector.BOOLEAN : matchTree = new BooleanMatcher(rootId); break; default: matchTree = new NumericMatcher(rootId); break; } if (enableCache) { this.rootId = rootId; matchCache = new MatchCache(MATCH_CACHE_INITIAL_CAPACITY); matchCache.setRehashFilter(this); ((EqualityMatcher) matchTree).setCacheing(true); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(cclass, "MatchSpaceImpl", this); }
java
public void initialise(Identifier rootId, boolean enableCache) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry(cclass, "initialise", new Object[] {rootId, new Boolean(enableCache)}); switch (rootId.getType()) { case Selector.UNKNOWN : case Selector.OBJECT : matchTree = new EqualityMatcher(rootId); break; case Selector.STRING : case Selector.TOPIC : matchTree = new StringMatcher(rootId); break; case Selector.BOOLEAN : matchTree = new BooleanMatcher(rootId); break; default: matchTree = new NumericMatcher(rootId); break; } if (enableCache) { this.rootId = rootId; matchCache = new MatchCache(MATCH_CACHE_INITIAL_CAPACITY); matchCache.setRehashFilter(this); ((EqualityMatcher) matchTree).setCacheing(true); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(cclass, "MatchSpaceImpl", this); }
[ "public", "void", "initialise", "(", "Identifier", "rootId", ",", "boolean", "enableCache", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "cclass", ",", "\"initialise\"", ",", "new", "Object", "[", "]", "{", "rootId", ",", "new", "Boolean", "(", "enableCache", ")", "}", ")", ";", "switch", "(", "rootId", ".", "getType", "(", ")", ")", "{", "case", "Selector", ".", "UNKNOWN", ":", "case", "Selector", ".", "OBJECT", ":", "matchTree", "=", "new", "EqualityMatcher", "(", "rootId", ")", ";", "break", ";", "case", "Selector", ".", "STRING", ":", "case", "Selector", ".", "TOPIC", ":", "matchTree", "=", "new", "StringMatcher", "(", "rootId", ")", ";", "break", ";", "case", "Selector", ".", "BOOLEAN", ":", "matchTree", "=", "new", "BooleanMatcher", "(", "rootId", ")", ";", "break", ";", "default", ":", "matchTree", "=", "new", "NumericMatcher", "(", "rootId", ")", ";", "break", ";", "}", "if", "(", "enableCache", ")", "{", "this", ".", "rootId", "=", "rootId", ";", "matchCache", "=", "new", "MatchCache", "(", "MATCH_CACHE_INITIAL_CAPACITY", ")", ";", "matchCache", ".", "setRehashFilter", "(", "this", ")", ";", "(", "(", "EqualityMatcher", ")", "matchTree", ")", ".", "setCacheing", "(", "true", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "cclass", ",", "\"MatchSpaceImpl\"", ",", "this", ")", ";", "}" ]
Initialise a newly created MatchSpace @param rootId @param enableCache
[ "Initialise", "a", "newly", "created", "MatchSpace" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java#L172-L202
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java
MatchSpaceImpl.addTarget
public synchronized void addTarget( Conjunction conjunction, MatchTarget object) throws MatchingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( this,cclass, "addTarget", new Object[] { conjunction, object }); // Deal with Conjunctions that test equality on rootId when cacheing is enabled if (rootId != null) { // Cacheing is enabled. OrdinalPosition rootOrd = new OrdinalPosition(0,0); SimpleTest test = Factory.findTest(rootOrd, conjunction); if (test != null && test.getKind() == SimpleTest.EQ) { // This is an equality test, so it goes in the cache only. CacheEntry e = getCacheEntry(test.getValue(), true); e.exactGeneration++; // even-odd transition: show we are changing it ContentMatcher exact = e.exactMatcher; e.exactMatcher = exact = Factory.createMatcher(rootOrd, conjunction, exact); e.cachedResults = null; try { exact.put(conjunction, object, subExpr); e.noResultCache |= exact.hasTests(); } catch (RuntimeException exc) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC.processException(this, cclass, "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget", exc, "1:303:1.44"); //TODO: tc.exception(tc, exc); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget", e); throw new MatchingException(exc); } finally { e.exactGeneration++; // odd-even transition: show change is complete } exactPuts++; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget"); return; } } // Either cacheing is not enabled or this isn't an equality test on rootId. matchTreeGeneration++; // even-odd transition: show we are changing it try { matchTree.put(conjunction, object, subExpr); } catch (RuntimeException e) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC.processException(this, cclass, "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget", e, "1:333:1.44"); //TODO: tc.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget", e); throw new MatchingException(e); } finally { matchTreeGeneration++; /* odd-even transition: show change is complete. Also invalidates non-equality information in the cache */ } wildPuts++; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget"); }
java
public synchronized void addTarget( Conjunction conjunction, MatchTarget object) throws MatchingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( this,cclass, "addTarget", new Object[] { conjunction, object }); // Deal with Conjunctions that test equality on rootId when cacheing is enabled if (rootId != null) { // Cacheing is enabled. OrdinalPosition rootOrd = new OrdinalPosition(0,0); SimpleTest test = Factory.findTest(rootOrd, conjunction); if (test != null && test.getKind() == SimpleTest.EQ) { // This is an equality test, so it goes in the cache only. CacheEntry e = getCacheEntry(test.getValue(), true); e.exactGeneration++; // even-odd transition: show we are changing it ContentMatcher exact = e.exactMatcher; e.exactMatcher = exact = Factory.createMatcher(rootOrd, conjunction, exact); e.cachedResults = null; try { exact.put(conjunction, object, subExpr); e.noResultCache |= exact.hasTests(); } catch (RuntimeException exc) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC.processException(this, cclass, "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget", exc, "1:303:1.44"); //TODO: tc.exception(tc, exc); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget", e); throw new MatchingException(exc); } finally { e.exactGeneration++; // odd-even transition: show change is complete } exactPuts++; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget"); return; } } // Either cacheing is not enabled or this isn't an equality test on rootId. matchTreeGeneration++; // even-odd transition: show we are changing it try { matchTree.put(conjunction, object, subExpr); } catch (RuntimeException e) { // No FFDC Code Needed. // FFDC driven by wrapper class. FFDC.processException(this, cclass, "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget", e, "1:333:1.44"); //TODO: tc.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget", e); throw new MatchingException(e); } finally { matchTreeGeneration++; /* odd-even transition: show change is complete. Also invalidates non-equality information in the cache */ } wildPuts++; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "addTarget"); }
[ "public", "synchronized", "void", "addTarget", "(", "Conjunction", "conjunction", ",", "MatchTarget", "object", ")", "throws", "MatchingException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "this", ",", "cclass", ",", "\"addTarget\"", ",", "new", "Object", "[", "]", "{", "conjunction", ",", "object", "}", ")", ";", "// Deal with Conjunctions that test equality on rootId when cacheing is enabled", "if", "(", "rootId", "!=", "null", ")", "{", "// Cacheing is enabled.", "OrdinalPosition", "rootOrd", "=", "new", "OrdinalPosition", "(", "0", ",", "0", ")", ";", "SimpleTest", "test", "=", "Factory", ".", "findTest", "(", "rootOrd", ",", "conjunction", ")", ";", "if", "(", "test", "!=", "null", "&&", "test", ".", "getKind", "(", ")", "==", "SimpleTest", ".", "EQ", ")", "{", "// This is an equality test, so it goes in the cache only. ", "CacheEntry", "e", "=", "getCacheEntry", "(", "test", ".", "getValue", "(", ")", ",", "true", ")", ";", "e", ".", "exactGeneration", "++", ";", "// even-odd transition: show we are changing it", "ContentMatcher", "exact", "=", "e", ".", "exactMatcher", ";", "e", ".", "exactMatcher", "=", "exact", "=", "Factory", ".", "createMatcher", "(", "rootOrd", ",", "conjunction", ",", "exact", ")", ";", "e", ".", "cachedResults", "=", "null", ";", "try", "{", "exact", ".", "put", "(", "conjunction", ",", "object", ",", "subExpr", ")", ";", "e", ".", "noResultCache", "|=", "exact", ".", "hasTests", "(", ")", ";", "}", "catch", "(", "RuntimeException", "exc", ")", "{", "// No FFDC Code Needed.", "// FFDC driven by wrapper class.", "FFDC", ".", "processException", "(", "this", ",", "cclass", ",", "\"com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget\"", ",", "exc", ",", "\"1:303:1.44\"", ")", ";", "//TODO: tc.exception(tc, exc);", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"addTarget\"", ",", "e", ")", ";", "throw", "new", "MatchingException", "(", "exc", ")", ";", "}", "finally", "{", "e", ".", "exactGeneration", "++", ";", "// odd-even transition: show change is complete", "}", "exactPuts", "++", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"addTarget\"", ")", ";", "return", ";", "}", "}", "// Either cacheing is not enabled or this isn't an equality test on rootId.", "matchTreeGeneration", "++", ";", "// even-odd transition: show we are changing it", "try", "{", "matchTree", ".", "put", "(", "conjunction", ",", "object", ",", "subExpr", ")", ";", "}", "catch", "(", "RuntimeException", "e", ")", "{", "// No FFDC Code Needed.", "// FFDC driven by wrapper class.", "FFDC", ".", "processException", "(", "this", ",", "cclass", ",", "\"com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget\"", ",", "e", ",", "\"1:333:1.44\"", ")", ";", "//TODO: tc.exception(tc, e);", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"addTarget\"", ",", "e", ")", ";", "throw", "new", "MatchingException", "(", "e", ")", ";", "}", "finally", "{", "matchTreeGeneration", "++", ";", "/* odd-even transition: show change is complete. Also\n invalidates non-equality information in the cache */", "}", "wildPuts", "++", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"addTarget\"", ")", ";", "}" ]
Adds a Conjunction to the space and associates a MatchTarget with it. @param conjunction the Conjunction @param target the MatchTarget @exception MatchingException thrown for serious errors, including an ill-formed conjunction. The Conjunction will be well-formed if it was constructed from a syntactically valid expression using a sound parser and Resolver.
[ "Adds", "a", "Conjunction", "to", "the", "space", "and", "associates", "a", "MatchTarget", "with", "it", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java#L218-L302
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java
MatchSpaceImpl.getCacheEntry
private CacheEntry getCacheEntry(Object value, boolean create) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( this,cclass, "getCacheEntry", new Object[] { value, new Boolean(create), matchCache }); CacheEntry e = (CacheEntry) matchCache.get(value); if (e == null) { if (create) { e = new CacheEntry(); // The following method call may stimulate multiple callbacks to the shouldRetain // method if the Hashtable is at the rehash threshold. matchCache.put(value, e); cacheCreates++; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "getCacheEntry", e); return e; }
java
private CacheEntry getCacheEntry(Object value, boolean create) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( this,cclass, "getCacheEntry", new Object[] { value, new Boolean(create), matchCache }); CacheEntry e = (CacheEntry) matchCache.get(value); if (e == null) { if (create) { e = new CacheEntry(); // The following method call may stimulate multiple callbacks to the shouldRetain // method if the Hashtable is at the rehash threshold. matchCache.put(value, e); cacheCreates++; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "getCacheEntry", e); return e; }
[ "private", "CacheEntry", "getCacheEntry", "(", "Object", "value", ",", "boolean", "create", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "this", ",", "cclass", ",", "\"getCacheEntry\"", ",", "new", "Object", "[", "]", "{", "value", ",", "new", "Boolean", "(", "create", ")", ",", "matchCache", "}", ")", ";", "CacheEntry", "e", "=", "(", "CacheEntry", ")", "matchCache", ".", "get", "(", "value", ")", ";", "if", "(", "e", "==", "null", ")", "{", "if", "(", "create", ")", "{", "e", "=", "new", "CacheEntry", "(", ")", ";", "// The following method call may stimulate multiple callbacks to the shouldRetain", "// method if the Hashtable is at the rehash threshold.", "matchCache", ".", "put", "(", "value", ",", "e", ")", ";", "cacheCreates", "++", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"getCacheEntry\"", ",", "e", ")", ";", "return", "e", ";", "}" ]
Gets the appropriate CacheEntry for a value of the root Identifier @param value the value whose CacheEntry is desired @param create if true, the CacheEntry is created (empty) if it doesn't already exist. This should only be done in synchronized methods.
[ "Gets", "the", "appropriate", "CacheEntry", "for", "a", "value", "of", "the", "root", "Identifier" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java#L315-L341
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java
MatchSpaceImpl.shouldRetain
public boolean shouldRetain(Object key, Object val) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry(this,cclass, "shouldRetain", new Object[] { key, val }); CacheEntry e = (CacheEntry) val; if (e.exactMatcher != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "shouldRetain", Boolean.TRUE); return true; } cacheRemoves++; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "shouldRetain", Boolean.FALSE); return false; }
java
public boolean shouldRetain(Object key, Object val) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry(this,cclass, "shouldRetain", new Object[] { key, val }); CacheEntry e = (CacheEntry) val; if (e.exactMatcher != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "shouldRetain", Boolean.TRUE); return true; } cacheRemoves++; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "shouldRetain", Boolean.FALSE); return false; }
[ "public", "boolean", "shouldRetain", "(", "Object", "key", ",", "Object", "val", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "this", ",", "cclass", ",", "\"shouldRetain\"", ",", "new", "Object", "[", "]", "{", "key", ",", "val", "}", ")", ";", "CacheEntry", "e", "=", "(", "CacheEntry", ")", "val", ";", "if", "(", "e", ".", "exactMatcher", "!=", "null", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"shouldRetain\"", ",", "Boolean", ".", "TRUE", ")", ";", "return", "true", ";", "}", "cacheRemoves", "++", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"shouldRetain\"", ",", "Boolean", ".", "FALSE", ")", ";", "return", "false", ";", "}" ]
entries that don't have an exactMatcher.
[ "entries", "that", "don", "t", "have", "an", "exactMatcher", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java#L347-L363
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java
MatchSpaceImpl.statistics
public void statistics(PrintWriter wtr) { int truePessimisticGets = pessimisticGets - puntsDueToCache; wtr.println( "Exact puts: " + exactPuts + ", Wildcard generation: " + matchTreeGeneration + ", Wildcard puts: " + wildPuts + ", Wildcard-Cache-hit gets: " + wildCacheHitGets + ", Wildcard-Cache-miss gets: " + wildCacheMissGets + ", Result-Cache-hit gets: " + resultCacheHitGets + ", Exact matches: " + exactMatches + ", Results cached: " + resultsCached + ", Removals:" + removals + ", Cache entries created:" + cacheCreates + ", Cache entries removed:" + cacheRemoves + ", Optimistic gets:" + optimisticGets + ", True Pessimistic gets:" + truePessimisticGets + ", Mutating gets:" + puntsDueToCache); }
java
public void statistics(PrintWriter wtr) { int truePessimisticGets = pessimisticGets - puntsDueToCache; wtr.println( "Exact puts: " + exactPuts + ", Wildcard generation: " + matchTreeGeneration + ", Wildcard puts: " + wildPuts + ", Wildcard-Cache-hit gets: " + wildCacheHitGets + ", Wildcard-Cache-miss gets: " + wildCacheMissGets + ", Result-Cache-hit gets: " + resultCacheHitGets + ", Exact matches: " + exactMatches + ", Results cached: " + resultsCached + ", Removals:" + removals + ", Cache entries created:" + cacheCreates + ", Cache entries removed:" + cacheRemoves + ", Optimistic gets:" + optimisticGets + ", True Pessimistic gets:" + truePessimisticGets + ", Mutating gets:" + puntsDueToCache); }
[ "public", "void", "statistics", "(", "PrintWriter", "wtr", ")", "{", "int", "truePessimisticGets", "=", "pessimisticGets", "-", "puntsDueToCache", ";", "wtr", ".", "println", "(", "\"Exact puts: \"", "+", "exactPuts", "+", "\", Wildcard generation: \"", "+", "matchTreeGeneration", "+", "\", Wildcard puts: \"", "+", "wildPuts", "+", "\", Wildcard-Cache-hit gets: \"", "+", "wildCacheHitGets", "+", "\", Wildcard-Cache-miss gets: \"", "+", "wildCacheMissGets", "+", "\", Result-Cache-hit gets: \"", "+", "resultCacheHitGets", "+", "\", Exact matches: \"", "+", "exactMatches", "+", "\", Results cached: \"", "+", "resultsCached", "+", "\", Removals:\"", "+", "removals", "+", "\", Cache entries created:\"", "+", "cacheCreates", "+", "\", Cache entries removed:\"", "+", "cacheRemoves", "+", "\", Optimistic gets:\"", "+", "optimisticGets", "+", "\", True Pessimistic gets:\"", "+", "truePessimisticGets", "+", "\", Mutating gets:\"", "+", "puntsDueToCache", ")", ";", "}" ]
Only used when doing isolated performance testing of the MatchSpace.
[ "Only", "used", "when", "doing", "isolated", "performance", "testing", "of", "the", "MatchSpace", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java#L821-L853
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java
MatchSpaceImpl.clear
public synchronized void clear(Identifier rootId, boolean enableCache) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry(this,cclass, "clear"); matchTree = null; matchTreeGeneration = 0; subExpr.clear(); // Now reinitialise the matchspace initialise(rootId, enableCache); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "clear"); }
java
public synchronized void clear(Identifier rootId, boolean enableCache) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry(this,cclass, "clear"); matchTree = null; matchTreeGeneration = 0; subExpr.clear(); // Now reinitialise the matchspace initialise(rootId, enableCache); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "clear"); }
[ "public", "synchronized", "void", "clear", "(", "Identifier", "rootId", ",", "boolean", "enableCache", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "this", ",", "cclass", ",", "\"clear\"", ")", ";", "matchTree", "=", "null", ";", "matchTreeGeneration", "=", "0", ";", "subExpr", ".", "clear", "(", ")", ";", "// Now reinitialise the matchspace", "initialise", "(", "rootId", ",", "enableCache", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"clear\"", ")", ";", "}" ]
Removes all objects from the MatchSpace, resetting it to the 'as new' condition.
[ "Removes", "all", "objects", "from", "the", "MatchSpace", "resetting", "it", "to", "the", "as", "new", "condition", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchSpaceImpl.java#L862-L874
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/DestinationSessionProxy.java
DestinationSessionProxy.getConnection
public SICoreConnection getConnection() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getConnection"); checkAlreadyClosed(); ConnectionProxy conn = getConnectionProxy(); conn.checkAlreadyClosed(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getConnection", conn); return conn; }
java
public SICoreConnection getConnection() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getConnection"); checkAlreadyClosed(); ConnectionProxy conn = getConnectionProxy(); conn.checkAlreadyClosed(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getConnection", conn); return conn; }
[ "public", "SICoreConnection", "getConnection", "(", ")", "throws", "SISessionUnavailableException", ",", "SISessionDroppedException", ",", "SIConnectionUnavailableException", ",", "SIConnectionDroppedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getConnection\"", ")", ";", "checkAlreadyClosed", "(", ")", ";", "ConnectionProxy", "conn", "=", "getConnectionProxy", "(", ")", ";", "conn", ".", "checkAlreadyClosed", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getConnection\"", ",", "conn", ")", ";", "return", "conn", ";", "}" ]
Returns the SICoreConnection which created this Session. @return SICoreConnection. @throws com.ibm.wsspi.sib.core.exception.SISessionUnavailableException @throws com.ibm.wsspi.sib.core.exception.SISessionDroppedException @throws com.ibm.wsspi.sib.core.exception.SIConnectionUnavailableException @throws com.ibm.wsspi.sib.core.exception.SIConnectionDroppedException
[ "Returns", "the", "SICoreConnection", "which", "created", "this", "Session", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/DestinationSessionProxy.java#L95-L108
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/DestinationSessionProxy.java
DestinationSessionProxy.checkAlreadyClosed
protected void checkAlreadyClosed() throws SISessionUnavailableException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "checkAlreadyClosed"); if (isClosed()) throw new SISessionUnavailableException( nls.getFormattedMessage("SESSION_CLOSED_SICO1013", null, null) ); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "checkAlreadyClosed"); }
java
protected void checkAlreadyClosed() throws SISessionUnavailableException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "checkAlreadyClosed"); if (isClosed()) throw new SISessionUnavailableException( nls.getFormattedMessage("SESSION_CLOSED_SICO1013", null, null) ); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "checkAlreadyClosed"); }
[ "protected", "void", "checkAlreadyClosed", "(", ")", "throws", "SISessionUnavailableException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"checkAlreadyClosed\"", ")", ";", "if", "(", "isClosed", "(", ")", ")", "throw", "new", "SISessionUnavailableException", "(", "nls", ".", "getFormattedMessage", "(", "\"SESSION_CLOSED_SICO1013\"", ",", "null", ",", "null", ")", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"checkAlreadyClosed\"", ")", ";", "}" ]
Helper method to check if this session is closed and throws the appropriate exception if it is. @throws SISessionUnavailableException if the session has been closed.
[ "Helper", "method", "to", "check", "if", "this", "session", "is", "closed", "and", "throws", "the", "appropriate", "exception", "if", "it", "is", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/DestinationSessionProxy.java#L116-L126
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/DestinationSessionProxy.java
DestinationSessionProxy.getDestinationAddress
public SIDestinationAddress getDestinationAddress() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDestinationAddress"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getDestinationAddress", destinationAddress); return destinationAddress; }
java
public SIDestinationAddress getDestinationAddress() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDestinationAddress"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getDestinationAddress", destinationAddress); return destinationAddress; }
[ "public", "SIDestinationAddress", "getDestinationAddress", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getDestinationAddress\"", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getDestinationAddress\"", ",", "destinationAddress", ")", ";", "return", "destinationAddress", ";", "}" ]
This method will return the destination address of the destination that this session is currently attached to. @return SIDestinationAddress
[ "This", "method", "will", "return", "the", "destination", "address", "of", "the", "destination", "that", "this", "session", "is", "currently", "attached", "to", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/DestinationSessionProxy.java#L134-L139
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmClientBootstrapRequest
public TrmClientBootstrapRequest createNewTrmClientBootstrapRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientBootstrapRequest"); TrmClientBootstrapRequest msg = null; try { msg = new TrmClientBootstrapRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientBootstrapRequest"); return msg; }
java
public TrmClientBootstrapRequest createNewTrmClientBootstrapRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientBootstrapRequest"); TrmClientBootstrapRequest msg = null; try { msg = new TrmClientBootstrapRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientBootstrapRequest"); return msg; }
[ "public", "TrmClientBootstrapRequest", "createNewTrmClientBootstrapRequest", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmClientBootstrapRequest\"", ")", ";", "TrmClientBootstrapRequest", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmClientBootstrapRequestImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmClientBootstrapRequest\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmClientBootstrapRequest message @return The new TrmClientBootstrapRequest. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmClientBootstrapRequest", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L48-L61
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmClientBootstrapReply
public TrmClientBootstrapReply createNewTrmClientBootstrapReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientBootstrapReply"); TrmClientBootstrapReply msg = null; try { msg = new TrmClientBootstrapReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientBootstrapReply"); return msg; }
java
public TrmClientBootstrapReply createNewTrmClientBootstrapReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientBootstrapReply"); TrmClientBootstrapReply msg = null; try { msg = new TrmClientBootstrapReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientBootstrapReply"); return msg; }
[ "public", "TrmClientBootstrapReply", "createNewTrmClientBootstrapReply", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmClientBootstrapReply\"", ")", ";", "TrmClientBootstrapReply", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmClientBootstrapReplyImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmClientBootstrapReply\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmClientBootstrapReply message @return The new TrmClientBootstrapReply. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmClientBootstrapReply", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L70-L83
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmClientAttachRequest
public TrmClientAttachRequest createNewTrmClientAttachRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachRequest"); TrmClientAttachRequest msg = null; try { msg = new TrmClientAttachRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachRequest"); return msg; }
java
public TrmClientAttachRequest createNewTrmClientAttachRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachRequest"); TrmClientAttachRequest msg = null; try { msg = new TrmClientAttachRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachRequest"); return msg; }
[ "public", "TrmClientAttachRequest", "createNewTrmClientAttachRequest", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmClientAttachRequest\"", ")", ";", "TrmClientAttachRequest", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmClientAttachRequestImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmClientAttachRequest\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmClientAttachRequest message @return The new TrmClientAttachRequest. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmClientAttachRequest", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L91-L104
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmClientAttachRequest2
public TrmClientAttachRequest2 createNewTrmClientAttachRequest2() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachRequest2"); TrmClientAttachRequest2 msg = null; try { msg = new TrmClientAttachRequest2Impl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachRequest2"); return msg; }
java
public TrmClientAttachRequest2 createNewTrmClientAttachRequest2() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachRequest2"); TrmClientAttachRequest2 msg = null; try { msg = new TrmClientAttachRequest2Impl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachRequest2"); return msg; }
[ "public", "TrmClientAttachRequest2", "createNewTrmClientAttachRequest2", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmClientAttachRequest2\"", ")", ";", "TrmClientAttachRequest2", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmClientAttachRequest2Impl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmClientAttachRequest2\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmClientAttachRequest2 message @return The new TrmClientAttachRequest2. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmClientAttachRequest2", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L112-L125
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmClientAttachReply
public TrmClientAttachReply createNewTrmClientAttachReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachReply"); TrmClientAttachReply msg = null; try { msg = new TrmClientAttachReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachReply"); return msg; }
java
public TrmClientAttachReply createNewTrmClientAttachReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmClientAttachReply"); TrmClientAttachReply msg = null; try { msg = new TrmClientAttachReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmClientAttachReply"); return msg; }
[ "public", "TrmClientAttachReply", "createNewTrmClientAttachReply", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmClientAttachReply\"", ")", ";", "TrmClientAttachReply", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmClientAttachReplyImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmClientAttachReply\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmClientAttachReply message @return The new TrmClientAttachReply. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmClientAttachReply", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L134-L147
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeConnectRequest
public TrmMeConnectRequest createNewTrmMeConnectRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeConnectRequest"); TrmMeConnectRequest msg = null; try { msg = new TrmMeConnectRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeConnectRequest"); return msg; }
java
public TrmMeConnectRequest createNewTrmMeConnectRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeConnectRequest"); TrmMeConnectRequest msg = null; try { msg = new TrmMeConnectRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeConnectRequest"); return msg; }
[ "public", "TrmMeConnectRequest", "createNewTrmMeConnectRequest", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeConnectRequest\"", ")", ";", "TrmMeConnectRequest", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeConnectRequestImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeConnectRequest\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeConnectRequest message @return The new TrmMeConnectRequest. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeConnectRequest", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L156-L169
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeConnectReply
public TrmMeConnectReply createNewTrmMeConnectReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeConnectReply"); TrmMeConnectReply msg = null; try { msg = new TrmMeConnectReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeConnectReply"); return msg; }
java
public TrmMeConnectReply createNewTrmMeConnectReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeConnectReply"); TrmMeConnectReply msg = null; try { msg = new TrmMeConnectReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeConnectReply"); return msg; }
[ "public", "TrmMeConnectReply", "createNewTrmMeConnectReply", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeConnectReply\"", ")", ";", "TrmMeConnectReply", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeConnectReplyImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeConnectReply\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeConnectReply message @return The new TrmMeConnectReply. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeConnectReply", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L178-L191
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeLinkRequest
public TrmMeLinkRequest createNewTrmMeLinkRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeLinkRequest"); TrmMeLinkRequest msg = null; try { msg = new TrmMeLinkRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeLinkRequest"); return msg; }
java
public TrmMeLinkRequest createNewTrmMeLinkRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeLinkRequest"); TrmMeLinkRequest msg = null; try { msg = new TrmMeLinkRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeLinkRequest"); return msg; }
[ "public", "TrmMeLinkRequest", "createNewTrmMeLinkRequest", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeLinkRequest\"", ")", ";", "TrmMeLinkRequest", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeLinkRequestImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeLinkRequest\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeLinkRequest message @return The new TrmMeLinkRequest. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeLinkRequest", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L200-L213
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeLinkReply
public TrmMeLinkReply createNewTrmMeLinkReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeLinkReply"); TrmMeLinkReply msg = null; try { msg = new TrmMeLinkReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeLinkReply"); return msg; }
java
public TrmMeLinkReply createNewTrmMeLinkReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeLinkReply"); TrmMeLinkReply msg = null; try { msg = new TrmMeLinkReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeLinkReply"); return msg; }
[ "public", "TrmMeLinkReply", "createNewTrmMeLinkReply", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeLinkReply\"", ")", ";", "TrmMeLinkReply", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeLinkReplyImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeLinkReply\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeLinkReply message @return The new TrmMeLinkReply. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeLinkReply", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L222-L235
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeBridgeRequest
public TrmMeBridgeRequest createNewTrmMeBridgeRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeRequest"); TrmMeBridgeRequest msg = null; try { msg = new TrmMeBridgeRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeRequest"); return msg; }
java
public TrmMeBridgeRequest createNewTrmMeBridgeRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeRequest"); TrmMeBridgeRequest msg = null; try { msg = new TrmMeBridgeRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeRequest"); return msg; }
[ "public", "TrmMeBridgeRequest", "createNewTrmMeBridgeRequest", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeBridgeRequest\"", ")", ";", "TrmMeBridgeRequest", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeBridgeRequestImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeBridgeRequest\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeBridgeRequest message @return The new TrmMeBridgeRequest. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeBridgeRequest", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L244-L257
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeBridgeReply
public TrmMeBridgeReply createNewTrmMeBridgeReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeReply"); TrmMeBridgeReply msg = null; try { msg = new TrmMeBridgeReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeReply"); return msg; }
java
public TrmMeBridgeReply createNewTrmMeBridgeReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeReply"); TrmMeBridgeReply msg = null; try { msg = new TrmMeBridgeReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeReply"); return msg; }
[ "public", "TrmMeBridgeReply", "createNewTrmMeBridgeReply", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeBridgeReply\"", ")", ";", "TrmMeBridgeReply", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeBridgeReplyImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeBridgeReply\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeBridgeReply message @return The new TrmMeBridgeReply. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeBridgeReply", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L266-L279
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeBridgeBootstrapRequest
public TrmMeBridgeBootstrapRequest createNewTrmMeBridgeBootstrapRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeBootstrapRequest"); TrmMeBridgeBootstrapRequest msg = null; try { msg = new TrmMeBridgeBootstrapRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeBootstrapRequest"); return msg; }
java
public TrmMeBridgeBootstrapRequest createNewTrmMeBridgeBootstrapRequest() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeBootstrapRequest"); TrmMeBridgeBootstrapRequest msg = null; try { msg = new TrmMeBridgeBootstrapRequestImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeBootstrapRequest"); return msg; }
[ "public", "TrmMeBridgeBootstrapRequest", "createNewTrmMeBridgeBootstrapRequest", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeBridgeBootstrapRequest\"", ")", ";", "TrmMeBridgeBootstrapRequest", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeBridgeBootstrapRequestImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeBridgeBootstrapRequest\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeBridgeBootstrapRequest message @return The new TrmMeBridgeBootstrapRequest. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeBridgeBootstrapRequest", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L288-L301
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createNewTrmMeBridgeBootstrapReply
public TrmMeBridgeBootstrapReply createNewTrmMeBridgeBootstrapReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeBootstrapReply"); TrmMeBridgeBootstrapReply msg = null; try { msg = new TrmMeBridgeBootstrapReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeBootstrapReply"); return msg; }
java
public TrmMeBridgeBootstrapReply createNewTrmMeBridgeBootstrapReply() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewTrmMeBridgeBootstrapReply"); TrmMeBridgeBootstrapReply msg = null; try { msg = new TrmMeBridgeBootstrapReplyImpl(); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewTrmMeBridgeBootstrapReply"); return msg; }
[ "public", "TrmMeBridgeBootstrapReply", "createNewTrmMeBridgeBootstrapReply", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNewTrmMeBridgeBootstrapReply\"", ")", ";", "TrmMeBridgeBootstrapReply", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmMeBridgeBootstrapReplyImpl", "(", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNewTrmMeBridgeBootstrapReply\"", ")", ";", "return", "msg", ";", "}" ]
Create a new, empty TrmMeBridgeBootstrapReply message @return The new TrmMeBridgeBootstrapReply. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "new", "empty", "TrmMeBridgeBootstrapReply", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L310-L323
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createInboundTrmFirstContactMessage
public TrmFirstContactMessage createInboundTrmFirstContactMessage(byte rawMessage[], int offset, int length) throws MessageDecodeFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createInboundTrmFirstContactMessage", new Object[]{rawMessage, Integer.valueOf(offset), Integer.valueOf(length)}); JsMsgObject jmo = new JsMsgObject(TrmFirstContactAccess.schema, rawMessage, offset, length); TrmFirstContactMessage message = new TrmFirstContactMessageImpl(jmo); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createInboundTrmFirstContactMessage", message); return message; }
java
public TrmFirstContactMessage createInboundTrmFirstContactMessage(byte rawMessage[], int offset, int length) throws MessageDecodeFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createInboundTrmFirstContactMessage", new Object[]{rawMessage, Integer.valueOf(offset), Integer.valueOf(length)}); JsMsgObject jmo = new JsMsgObject(TrmFirstContactAccess.schema, rawMessage, offset, length); TrmFirstContactMessage message = new TrmFirstContactMessageImpl(jmo); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createInboundTrmFirstContactMessage", message); return message; }
[ "public", "TrmFirstContactMessage", "createInboundTrmFirstContactMessage", "(", "byte", "rawMessage", "[", "]", ",", "int", "offset", ",", "int", "length", ")", "throws", "MessageDecodeFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createInboundTrmFirstContactMessage\"", ",", "new", "Object", "[", "]", "{", "rawMessage", ",", "Integer", ".", "valueOf", "(", "offset", ")", ",", "Integer", ".", "valueOf", "(", "length", ")", "}", ")", ";", "JsMsgObject", "jmo", "=", "new", "JsMsgObject", "(", "TrmFirstContactAccess", ".", "schema", ",", "rawMessage", ",", "offset", ",", "length", ")", ";", "TrmFirstContactMessage", "message", "=", "new", "TrmFirstContactMessageImpl", "(", "jmo", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createInboundTrmFirstContactMessage\"", ",", "message", ")", ";", "return", "message", ";", "}" ]
Create a TrmFirstContactMessage to represent an inbound message. @param rawMessage The inbound byte array containging a complete message @param offset The offset in the byte array at which the message begins @param length The length of the message within the byte array @return The new TrmFirstContactMessage @exception MessageDecodeFailedException Thrown if the inbound message could not be decoded
[ "Create", "a", "TrmFirstContactMessage", "to", "represent", "an", "inbound", "message", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L336-L346
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java
TrmMessageFactoryImpl.createTrmRouteData
public TrmRouteData createTrmRouteData() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createTrmRouteData"); TrmRouteData msg = null; try { msg = new TrmRouteDataImpl(MfpConstants.CONSTRUCTOR_NO_OP); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createTrmRouteData"); return msg; }
java
public TrmRouteData createTrmRouteData() throws MessageCreateFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createTrmRouteData"); TrmRouteData msg = null; try { msg = new TrmRouteDataImpl(MfpConstants.CONSTRUCTOR_NO_OP); } catch (MessageDecodeFailedException e) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed throw new MessageCreateFailedException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createTrmRouteData"); return msg; }
[ "public", "TrmRouteData", "createTrmRouteData", "(", ")", "throws", "MessageCreateFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createTrmRouteData\"", ")", ";", "TrmRouteData", "msg", "=", "null", ";", "try", "{", "msg", "=", "new", "TrmRouteDataImpl", "(", "MfpConstants", ".", "CONSTRUCTOR_NO_OP", ")", ";", "}", "catch", "(", "MessageDecodeFailedException", "e", ")", "{", "/* No need to FFDC this as JsMsgObject will already have done so */", "// No FFDC code needed", "throw", "new", "MessageCreateFailedException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createTrmRouteData\"", ")", ";", "return", "msg", ";", "}" ]
Create a TrmRouteData message @return The new TrmRouteData. @exception MessageCreateFailedException Thrown if such a message can not be created
[ "Create", "a", "TrmRouteData", "message" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/TrmMessageFactoryImpl.java#L360-L373
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java
SchemaStoreItemStream.eventRestored
public void eventRestored() throws SevereMessageStoreException { super.eventRestored(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "eventRestored"); try { NonLockingCursor cursor = newNonLockingItemCursor(null); AbstractItem item = cursor.next(); while (item != null) { if (item instanceof SchemaStoreItem) { addToIndex((SchemaStoreItem)item); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "JSchema found in store: " + ((SchemaStoreItem)item).getSchema().getID()); } item = cursor.next(); } } catch (MessageStoreException e) { FFDCFilter.processException(e, "eventRestored", "108", this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "eventRestored"); }
java
public void eventRestored() throws SevereMessageStoreException { super.eventRestored(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "eventRestored"); try { NonLockingCursor cursor = newNonLockingItemCursor(null); AbstractItem item = cursor.next(); while (item != null) { if (item instanceof SchemaStoreItem) { addToIndex((SchemaStoreItem)item); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "JSchema found in store: " + ((SchemaStoreItem)item).getSchema().getID()); } item = cursor.next(); } } catch (MessageStoreException e) { FFDCFilter.processException(e, "eventRestored", "108", this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "eventRestored"); }
[ "public", "void", "eventRestored", "(", ")", "throws", "SevereMessageStoreException", "{", "super", ".", "eventRestored", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"eventRestored\"", ")", ";", "try", "{", "NonLockingCursor", "cursor", "=", "newNonLockingItemCursor", "(", "null", ")", ";", "AbstractItem", "item", "=", "cursor", ".", "next", "(", ")", ";", "while", "(", "item", "!=", "null", ")", "{", "if", "(", "item", "instanceof", "SchemaStoreItem", ")", "{", "addToIndex", "(", "(", "SchemaStoreItem", ")", "item", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"JSchema found in store: \"", "+", "(", "(", "SchemaStoreItem", ")", "item", ")", ".", "getSchema", "(", ")", ".", "getID", "(", ")", ")", ";", "}", "item", "=", "cursor", ".", "next", "(", ")", ";", "}", "}", "catch", "(", "MessageStoreException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"eventRestored\"", ",", "\"108\"", ",", "this", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"eventRestored\"", ")", ";", "}" ]
the message store. We build the index of any currently stored items.
[ "the", "message", "store", ".", "We", "build", "the", "index", "of", "any", "currently", "stored", "items", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java#L72-L89
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java
SchemaStoreItemStream.addSchema
void addSchema(JMFSchema schema, Transaction tran) throws MessageStoreException { addItem(new SchemaStoreItem(schema), tran); }
java
void addSchema(JMFSchema schema, Transaction tran) throws MessageStoreException { addItem(new SchemaStoreItem(schema), tran); }
[ "void", "addSchema", "(", "JMFSchema", "schema", ",", "Transaction", "tran", ")", "throws", "MessageStoreException", "{", "addItem", "(", "new", "SchemaStoreItem", "(", "schema", ")", ",", "tran", ")", ";", "}" ]
Add a new schema defintion to the store
[ "Add", "a", "new", "schema", "defintion", "to", "the", "store" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java#L113-L115
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java
SchemaStoreItemStream.findSchema
JMFSchema findSchema(long schemaId) throws MessageStoreException { Long storeId = schemaIndex.get(Long.valueOf(schemaId)); if (storeId != null) { AbstractItem item = findById(storeId.longValue()); return ((SchemaStoreItem)item).getSchema(); } else throw new MessageStoreException("Schema not found in store: " + schemaId); }
java
JMFSchema findSchema(long schemaId) throws MessageStoreException { Long storeId = schemaIndex.get(Long.valueOf(schemaId)); if (storeId != null) { AbstractItem item = findById(storeId.longValue()); return ((SchemaStoreItem)item).getSchema(); } else throw new MessageStoreException("Schema not found in store: " + schemaId); }
[ "JMFSchema", "findSchema", "(", "long", "schemaId", ")", "throws", "MessageStoreException", "{", "Long", "storeId", "=", "schemaIndex", ".", "get", "(", "Long", ".", "valueOf", "(", "schemaId", ")", ")", ";", "if", "(", "storeId", "!=", "null", ")", "{", "AbstractItem", "item", "=", "findById", "(", "storeId", ".", "longValue", "(", ")", ")", ";", "return", "(", "(", "SchemaStoreItem", ")", "item", ")", ".", "getSchema", "(", ")", ";", "}", "else", "throw", "new", "MessageStoreException", "(", "\"Schema not found in store: \"", "+", "schemaId", ")", ";", "}" ]
Restore a schema definition from the store
[ "Restore", "a", "schema", "definition", "from", "the", "store" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java#L118-L125
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java
SchemaStoreItemStream.addToIndex
void addToIndex(SchemaStoreItem item) throws NotInMessageStore { schemaIndex.put(item.getSchema().getLongID(), Long.valueOf(item.getID())); item.setStream(this); }
java
void addToIndex(SchemaStoreItem item) throws NotInMessageStore { schemaIndex.put(item.getSchema().getLongID(), Long.valueOf(item.getID())); item.setStream(this); }
[ "void", "addToIndex", "(", "SchemaStoreItem", "item", ")", "throws", "NotInMessageStore", "{", "schemaIndex", ".", "put", "(", "item", ".", "getSchema", "(", ")", ".", "getLongID", "(", ")", ",", "Long", ".", "valueOf", "(", "item", ".", "getID", "(", ")", ")", ")", ";", "item", ".", "setStream", "(", "this", ")", ";", "}" ]
Add an item to our index
[ "Add", "an", "item", "to", "our", "index" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java#L128-L131
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java
SchemaStoreItemStream.removeFromIndex
void removeFromIndex(SchemaStoreItem item) { schemaIndex.remove(item.getSchema().getLongID()); item.setStream(null); }
java
void removeFromIndex(SchemaStoreItem item) { schemaIndex.remove(item.getSchema().getLongID()); item.setStream(null); }
[ "void", "removeFromIndex", "(", "SchemaStoreItem", "item", ")", "{", "schemaIndex", ".", "remove", "(", "item", ".", "getSchema", "(", ")", ".", "getLongID", "(", ")", ")", ";", "item", ".", "setStream", "(", "null", ")", ";", "}" ]
Remove an item from our index
[ "Remove", "an", "item", "from", "our", "index" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/SchemaStoreItemStream.java#L134-L137
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSPKCSInKeyStoreList.java
WSPKCSInKeyStoreList.insert
public synchronized WSPKCSInKeyStore insert(String tokenType, String tokenlib, String tokenPwd, boolean askeystore, String keyStoreProvider) throws Exception { // check to see if the library has been initialized already;by comparing // the elements in the enumerations // perhaps a java 2 sec mgr if (tc.isEntryEnabled()) Tr.entry(tc, "insert", new Object[] { tokenType, tokenlib, keyStoreProvider }); WSPKCSInKeyStore pKS = insertedAlready(tokenlib); boolean already = false; // what is inserted already, but not as the askeystore specified. In // other words, askeystore indicates keystore, but // the pKS was inserted as truststore. // looks like we have not inserted anything yet. if (pKS == null) { pKS = new WSPKCSInKeyStore(tokenlib, keyStoreProvider); } else { already = true; } if (askeystore) pKS.asKeyStore(tokenType, tokenlib, tokenPwd); else pKS.asTrustStore(tokenType, tokenlib, tokenPwd); if (!already) theV.add(pKS); if (tc.isEntryEnabled()) { Tr.exit(tc, "insert"); } return pKS; }
java
public synchronized WSPKCSInKeyStore insert(String tokenType, String tokenlib, String tokenPwd, boolean askeystore, String keyStoreProvider) throws Exception { // check to see if the library has been initialized already;by comparing // the elements in the enumerations // perhaps a java 2 sec mgr if (tc.isEntryEnabled()) Tr.entry(tc, "insert", new Object[] { tokenType, tokenlib, keyStoreProvider }); WSPKCSInKeyStore pKS = insertedAlready(tokenlib); boolean already = false; // what is inserted already, but not as the askeystore specified. In // other words, askeystore indicates keystore, but // the pKS was inserted as truststore. // looks like we have not inserted anything yet. if (pKS == null) { pKS = new WSPKCSInKeyStore(tokenlib, keyStoreProvider); } else { already = true; } if (askeystore) pKS.asKeyStore(tokenType, tokenlib, tokenPwd); else pKS.asTrustStore(tokenType, tokenlib, tokenPwd); if (!already) theV.add(pKS); if (tc.isEntryEnabled()) { Tr.exit(tc, "insert"); } return pKS; }
[ "public", "synchronized", "WSPKCSInKeyStore", "insert", "(", "String", "tokenType", ",", "String", "tokenlib", ",", "String", "tokenPwd", ",", "boolean", "askeystore", ",", "String", "keyStoreProvider", ")", "throws", "Exception", "{", "// check to see if the library has been initialized already;by comparing", "// the elements in the enumerations", "// perhaps a java 2 sec mgr", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"insert\"", ",", "new", "Object", "[", "]", "{", "tokenType", ",", "tokenlib", ",", "keyStoreProvider", "}", ")", ";", "WSPKCSInKeyStore", "pKS", "=", "insertedAlready", "(", "tokenlib", ")", ";", "boolean", "already", "=", "false", ";", "// what is inserted already, but not as the askeystore specified. In", "// other words, askeystore indicates keystore, but", "// the pKS was inserted as truststore.", "// looks like we have not inserted anything yet.", "if", "(", "pKS", "==", "null", ")", "{", "pKS", "=", "new", "WSPKCSInKeyStore", "(", "tokenlib", ",", "keyStoreProvider", ")", ";", "}", "else", "{", "already", "=", "true", ";", "}", "if", "(", "askeystore", ")", "pKS", ".", "asKeyStore", "(", "tokenType", ",", "tokenlib", ",", "tokenPwd", ")", ";", "else", "pKS", ".", "asTrustStore", "(", "tokenType", ",", "tokenlib", ",", "tokenPwd", ")", ";", "if", "(", "!", "already", ")", "theV", ".", "add", "(", "pKS", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "tc", ",", "\"insert\"", ")", ";", "}", "return", "pKS", ";", "}" ]
Insert a new keystore into the list. @param tokenType @param tokenlib @param tokenPwd @param askeystore @param contextProvider @param pureAcceleration @return WSPKCSInKeyStore @throws Exception
[ "Insert", "a", "new", "keystore", "into", "the", "list", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSPKCSInKeyStoreList.java#L61-L93
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSPKCSInKeyStoreList.java
WSPKCSInKeyStoreList.insertedAlready
private WSPKCSInKeyStore insertedAlready(String tokenlib) { WSPKCSInKeyStore pKS = null; WSPKCSInKeyStore rc = null; Enumeration<WSPKCSInKeyStore> e = theV.elements(); while (null == rc && e.hasMoreElements()) { pKS = e.nextElement(); if (tokenlib.equalsIgnoreCase(pKS.getlibName_key())) { rc = pKS; } else if (tokenlib.equalsIgnoreCase(pKS.getlibName_trust())) { rc = pKS; } } return rc; }
java
private WSPKCSInKeyStore insertedAlready(String tokenlib) { WSPKCSInKeyStore pKS = null; WSPKCSInKeyStore rc = null; Enumeration<WSPKCSInKeyStore> e = theV.elements(); while (null == rc && e.hasMoreElements()) { pKS = e.nextElement(); if (tokenlib.equalsIgnoreCase(pKS.getlibName_key())) { rc = pKS; } else if (tokenlib.equalsIgnoreCase(pKS.getlibName_trust())) { rc = pKS; } } return rc; }
[ "private", "WSPKCSInKeyStore", "insertedAlready", "(", "String", "tokenlib", ")", "{", "WSPKCSInKeyStore", "pKS", "=", "null", ";", "WSPKCSInKeyStore", "rc", "=", "null", ";", "Enumeration", "<", "WSPKCSInKeyStore", ">", "e", "=", "theV", ".", "elements", "(", ")", ";", "while", "(", "null", "==", "rc", "&&", "e", ".", "hasMoreElements", "(", ")", ")", "{", "pKS", "=", "e", ".", "nextElement", "(", ")", ";", "if", "(", "tokenlib", ".", "equalsIgnoreCase", "(", "pKS", ".", "getlibName_key", "(", ")", ")", ")", "{", "rc", "=", "pKS", ";", "}", "else", "if", "(", "tokenlib", ".", "equalsIgnoreCase", "(", "pKS", ".", "getlibName_trust", "(", ")", ")", ")", "{", "rc", "=", "pKS", ";", "}", "}", "return", "rc", ";", "}" ]
Lookup the keystore object that may exist in the list for the input token library value. @param tokenlib @return WSPKCSInKeyStore - null if not found
[ "Lookup", "the", "keystore", "object", "that", "may", "exist", "in", "the", "list", "for", "the", "input", "token", "library", "value", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSPKCSInKeyStoreList.java#L123-L139
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSPKCSInKeyStoreList.java
WSPKCSInKeyStoreList.openKeyStore
public InputStream openKeyStore(String fileName) throws MalformedURLException, IOException { InputStream fis = null; URL urlFile = null; File kfile = null; try { kfile = new File(fileName); } catch (NullPointerException e) { throw new IOException(); } try { if (kfile.exists()) { // its a file that is there if (kfile.length() == 0) { // the keystore file is empty // debug throw new IOException(fileName); } // get the url syntax for the fully-qualified filename urlFile = new URL("file:" + kfile.getCanonicalPath()); } else { // otherwise, its a url or a file that doesn't exist try { urlFile = new URL(fileName); } catch (MalformedURLException e) { // not proper url syntax // -or- a file that doesn't exist, we don't know which. // error message throw e; } } } catch (SecurityException e) { // error message throw new IOException(fileName); } // Attempt to open the keystore file try { fis = urlFile.openStream(); } catch (IOException e) { // error message throw e; } return fis; }
java
public InputStream openKeyStore(String fileName) throws MalformedURLException, IOException { InputStream fis = null; URL urlFile = null; File kfile = null; try { kfile = new File(fileName); } catch (NullPointerException e) { throw new IOException(); } try { if (kfile.exists()) { // its a file that is there if (kfile.length() == 0) { // the keystore file is empty // debug throw new IOException(fileName); } // get the url syntax for the fully-qualified filename urlFile = new URL("file:" + kfile.getCanonicalPath()); } else { // otherwise, its a url or a file that doesn't exist try { urlFile = new URL(fileName); } catch (MalformedURLException e) { // not proper url syntax // -or- a file that doesn't exist, we don't know which. // error message throw e; } } } catch (SecurityException e) { // error message throw new IOException(fileName); } // Attempt to open the keystore file try { fis = urlFile.openStream(); } catch (IOException e) { // error message throw e; } return fis; }
[ "public", "InputStream", "openKeyStore", "(", "String", "fileName", ")", "throws", "MalformedURLException", ",", "IOException", "{", "InputStream", "fis", "=", "null", ";", "URL", "urlFile", "=", "null", ";", "File", "kfile", "=", "null", ";", "try", "{", "kfile", "=", "new", "File", "(", "fileName", ")", ";", "}", "catch", "(", "NullPointerException", "e", ")", "{", "throw", "new", "IOException", "(", ")", ";", "}", "try", "{", "if", "(", "kfile", ".", "exists", "(", ")", ")", "{", "// its a file that is there", "if", "(", "kfile", ".", "length", "(", ")", "==", "0", ")", "{", "// the keystore file is empty", "// debug", "throw", "new", "IOException", "(", "fileName", ")", ";", "}", "// get the url syntax for the fully-qualified filename", "urlFile", "=", "new", "URL", "(", "\"file:\"", "+", "kfile", ".", "getCanonicalPath", "(", ")", ")", ";", "}", "else", "{", "// otherwise, its a url or a file that doesn't exist", "try", "{", "urlFile", "=", "new", "URL", "(", "fileName", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "// not proper url syntax", "// -or- a file that doesn't exist, we don't know which.", "// error message", "throw", "e", ";", "}", "}", "}", "catch", "(", "SecurityException", "e", ")", "{", "// error message", "throw", "new", "IOException", "(", "fileName", ")", ";", "}", "// Attempt to open the keystore file", "try", "{", "fis", "=", "urlFile", ".", "openStream", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "// error message", "throw", "e", ";", "}", "return", "fis", ";", "}" ]
Open the input filename as a stream. @param fileName @return InputStream @throws MalformedURLException @throws IOException
[ "Open", "the", "input", "filename", "as", "a", "stream", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSPKCSInKeyStoreList.java#L149-L204
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.shared/src/com/ibm/ws/jsf/shared/util/JSFInjectionClassListCollaborator.java
JSFInjectionClassListCollaborator.addAlternateNamedFacesConfig
private void addAlternateNamedFacesConfig(Container moduleContainer, ArrayList<String> classList) { try { WebApp webapp = moduleContainer.adapt(WebApp.class); //If null, assume there was no web.xml, so no need to look for ContextParams in it. if (webapp == null) { return; } List<ParamValue> params = webapp.getContextParams(); String configNames = null; for (ParamValue param : params) { if (param.getName().equals(FACES_CONFIG_NAMES)) { configNames = param.getValue(); break; } } //If we didn't find the param, then bail out if (configNames == null) return; //Treat value as a comma delimited list of file names StringTokenizer st = new StringTokenizer(configNames, ","); while (st.hasMoreTokens()) { addConfigFileBeans(moduleContainer.getEntry(st.nextToken()), classList); } } catch (UnableToAdaptException e) { if (log.isLoggable(Level.FINE)) { log.logp(Level.FINE, CLASS_NAME, "addAlternateNamedFacesConfig", "failed to adapt conatiner to WebApp", e); } } }
java
private void addAlternateNamedFacesConfig(Container moduleContainer, ArrayList<String> classList) { try { WebApp webapp = moduleContainer.adapt(WebApp.class); //If null, assume there was no web.xml, so no need to look for ContextParams in it. if (webapp == null) { return; } List<ParamValue> params = webapp.getContextParams(); String configNames = null; for (ParamValue param : params) { if (param.getName().equals(FACES_CONFIG_NAMES)) { configNames = param.getValue(); break; } } //If we didn't find the param, then bail out if (configNames == null) return; //Treat value as a comma delimited list of file names StringTokenizer st = new StringTokenizer(configNames, ","); while (st.hasMoreTokens()) { addConfigFileBeans(moduleContainer.getEntry(st.nextToken()), classList); } } catch (UnableToAdaptException e) { if (log.isLoggable(Level.FINE)) { log.logp(Level.FINE, CLASS_NAME, "addAlternateNamedFacesConfig", "failed to adapt conatiner to WebApp", e); } } }
[ "private", "void", "addAlternateNamedFacesConfig", "(", "Container", "moduleContainer", ",", "ArrayList", "<", "String", ">", "classList", ")", "{", "try", "{", "WebApp", "webapp", "=", "moduleContainer", ".", "adapt", "(", "WebApp", ".", "class", ")", ";", "//If null, assume there was no web.xml, so no need to look for ContextParams in it.", "if", "(", "webapp", "==", "null", ")", "{", "return", ";", "}", "List", "<", "ParamValue", ">", "params", "=", "webapp", ".", "getContextParams", "(", ")", ";", "String", "configNames", "=", "null", ";", "for", "(", "ParamValue", "param", ":", "params", ")", "{", "if", "(", "param", ".", "getName", "(", ")", ".", "equals", "(", "FACES_CONFIG_NAMES", ")", ")", "{", "configNames", "=", "param", ".", "getValue", "(", ")", ";", "break", ";", "}", "}", "//If we didn't find the param, then bail out", "if", "(", "configNames", "==", "null", ")", "return", ";", "//Treat value as a comma delimited list of file names", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "configNames", ",", "\",\"", ")", ";", "while", "(", "st", ".", "hasMoreTokens", "(", ")", ")", "{", "addConfigFileBeans", "(", "moduleContainer", ".", "getEntry", "(", "st", ".", "nextToken", "(", ")", ")", ",", "classList", ")", ";", "}", "}", "catch", "(", "UnableToAdaptException", "e", ")", "{", "if", "(", "log", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "log", ".", "logp", "(", "Level", ".", "FINE", ",", "CLASS_NAME", ",", "\"addAlternateNamedFacesConfig\"", ",", "\"failed to adapt conatiner to WebApp\"", ",", "e", ")", ";", "}", "}", "}" ]
Look at the web.xml for a context-param javax.faces.CONFIG_FILES, and treat as a comma delimited list
[ "Look", "at", "the", "web", ".", "xml", "for", "a", "context", "-", "param", "javax", ".", "faces", ".", "CONFIG_FILES", "and", "treat", "as", "a", "comma", "delimited", "list" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.shared/src/com/ibm/ws/jsf/shared/util/JSFInjectionClassListCollaborator.java#L181-L214
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getServiceQName
public static QName getServiceQName(ClassInfo classInfo, String seiClassName, String targetNamespace) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, "Service QName"); if (annotationInfo == null) { return null; } //serviceName can only be defined in implementation bean, targetNamespace should be the implemented one. return getQName(classInfo, targetNamespace, annotationInfo.getValue(JaxWsConstants.SERVICENAME_ATTRIBUTE).getStringValue(), JaxWsConstants.SERVICENAME_ATTRIBUTE_SUFFIX); }
java
public static QName getServiceQName(ClassInfo classInfo, String seiClassName, String targetNamespace) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, "Service QName"); if (annotationInfo == null) { return null; } //serviceName can only be defined in implementation bean, targetNamespace should be the implemented one. return getQName(classInfo, targetNamespace, annotationInfo.getValue(JaxWsConstants.SERVICENAME_ATTRIBUTE).getStringValue(), JaxWsConstants.SERVICENAME_ATTRIBUTE_SUFFIX); }
[ "public", "static", "QName", "getServiceQName", "(", "ClassInfo", "classInfo", ",", "String", "seiClassName", ",", "String", "targetNamespace", ")", "{", "AnnotationInfo", "annotationInfo", "=", "getAnnotationInfoFromClass", "(", "classInfo", ",", "\"Service QName\"", ")", ";", "if", "(", "annotationInfo", "==", "null", ")", "{", "return", "null", ";", "}", "//serviceName can only be defined in implementation bean, targetNamespace should be the implemented one.", "return", "getQName", "(", "classInfo", ",", "targetNamespace", ",", "annotationInfo", ".", "getValue", "(", "JaxWsConstants", ".", "SERVICENAME_ATTRIBUTE", ")", ".", "getStringValue", "(", ")", ",", "JaxWsConstants", ".", "SERVICENAME_ATTRIBUTE_SUFFIX", ")", ";", "}" ]
Get serviceName's QName of Web Service @param classInfo @return
[ "Get", "serviceName", "s", "QName", "of", "Web", "Service" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L92-L102
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getPortQName
public static QName getPortQName(ClassInfo classInfo, String seiClassName, String targetNamespace) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, "Port QName"); if (annotationInfo == null) { return null; } boolean webServiceProviderAnnotation = isProvider(classInfo); String wsName = webServiceProviderAnnotation ? null : annotationInfo.getValue(JaxWsConstants.NAME_ATTRIBUTE).getStringValue(); return getPortQName(classInfo, targetNamespace, wsName, annotationInfo.getValue(JaxWsConstants.PORTNAME_ATTRIBUTE).getStringValue(), JaxWsConstants.PORTNAME_ATTRIBUTE_SUFFIX); }
java
public static QName getPortQName(ClassInfo classInfo, String seiClassName, String targetNamespace) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, "Port QName"); if (annotationInfo == null) { return null; } boolean webServiceProviderAnnotation = isProvider(classInfo); String wsName = webServiceProviderAnnotation ? null : annotationInfo.getValue(JaxWsConstants.NAME_ATTRIBUTE).getStringValue(); return getPortQName(classInfo, targetNamespace, wsName, annotationInfo.getValue(JaxWsConstants.PORTNAME_ATTRIBUTE).getStringValue(), JaxWsConstants.PORTNAME_ATTRIBUTE_SUFFIX); }
[ "public", "static", "QName", "getPortQName", "(", "ClassInfo", "classInfo", ",", "String", "seiClassName", ",", "String", "targetNamespace", ")", "{", "AnnotationInfo", "annotationInfo", "=", "getAnnotationInfoFromClass", "(", "classInfo", ",", "\"Port QName\"", ")", ";", "if", "(", "annotationInfo", "==", "null", ")", "{", "return", "null", ";", "}", "boolean", "webServiceProviderAnnotation", "=", "isProvider", "(", "classInfo", ")", ";", "String", "wsName", "=", "webServiceProviderAnnotation", "?", "null", ":", "annotationInfo", ".", "getValue", "(", "JaxWsConstants", ".", "NAME_ATTRIBUTE", ")", ".", "getStringValue", "(", ")", ";", "return", "getPortQName", "(", "classInfo", ",", "targetNamespace", ",", "wsName", ",", "annotationInfo", ".", "getValue", "(", "JaxWsConstants", ".", "PORTNAME_ATTRIBUTE", ")", ".", "getStringValue", "(", ")", ",", "JaxWsConstants", ".", "PORTNAME_ATTRIBUTE_SUFFIX", ")", ";", "}" ]
Get portName' QName of Web Service @param classInfo @return
[ "Get", "portName", "QName", "of", "Web", "Service" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L141-L152
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.isProvider
public static boolean isProvider(ClassInfo classInfo) { AnnotationInfo annotationInfo = classInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_ANNOTATION_NAME); if (annotationInfo == null) { annotationInfo = classInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_PROVIDER_ANNOTATION_NAME); if (annotationInfo != null) { return true; } } return false; }
java
public static boolean isProvider(ClassInfo classInfo) { AnnotationInfo annotationInfo = classInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_ANNOTATION_NAME); if (annotationInfo == null) { annotationInfo = classInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_PROVIDER_ANNOTATION_NAME); if (annotationInfo != null) { return true; } } return false; }
[ "public", "static", "boolean", "isProvider", "(", "ClassInfo", "classInfo", ")", "{", "AnnotationInfo", "annotationInfo", "=", "classInfo", ".", "getAnnotation", "(", "JaxWsConstants", ".", "WEB_SERVICE_ANNOTATION_NAME", ")", ";", "if", "(", "annotationInfo", "==", "null", ")", "{", "annotationInfo", "=", "classInfo", ".", "getAnnotation", "(", "JaxWsConstants", ".", "WEB_SERVICE_PROVIDER_ANNOTATION_NAME", ")", ";", "if", "(", "annotationInfo", "!=", "null", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Judge if is a Web Service Provider. @param classInfo @return
[ "Judge", "if", "is", "a", "Web", "Service", "Provider", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L177-L186
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getImplementedTargetNamespace
public static String getImplementedTargetNamespace(ClassInfo classInfo) { String defaultValue = getNamespace(classInfo, null); if (StringUtils.isEmpty(defaultValue)) { defaultValue = JaxWsConstants.UNKNOWN_NAMESPACE; } AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); if (annotationInfo == null) { return ""; } AnnotationValue attrValue = annotationInfo.getValue(JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); String attrFromAnnotation = attrValue == null ? null : attrValue.getStringValue().trim(); return StringUtils.isEmpty(attrFromAnnotation) ? defaultValue : attrFromAnnotation; }
java
public static String getImplementedTargetNamespace(ClassInfo classInfo) { String defaultValue = getNamespace(classInfo, null); if (StringUtils.isEmpty(defaultValue)) { defaultValue = JaxWsConstants.UNKNOWN_NAMESPACE; } AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); if (annotationInfo == null) { return ""; } AnnotationValue attrValue = annotationInfo.getValue(JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); String attrFromAnnotation = attrValue == null ? null : attrValue.getStringValue().trim(); return StringUtils.isEmpty(attrFromAnnotation) ? defaultValue : attrFromAnnotation; }
[ "public", "static", "String", "getImplementedTargetNamespace", "(", "ClassInfo", "classInfo", ")", "{", "String", "defaultValue", "=", "getNamespace", "(", "classInfo", ",", "null", ")", ";", "if", "(", "StringUtils", ".", "isEmpty", "(", "defaultValue", ")", ")", "{", "defaultValue", "=", "JaxWsConstants", ".", "UNKNOWN_NAMESPACE", ";", "}", "AnnotationInfo", "annotationInfo", "=", "getAnnotationInfoFromClass", "(", "classInfo", ",", "JaxWsConstants", ".", "TARGETNAMESPACE_ATTRIBUTE", ")", ";", "if", "(", "annotationInfo", "==", "null", ")", "{", "return", "\"\"", ";", "}", "AnnotationValue", "attrValue", "=", "annotationInfo", ".", "getValue", "(", "JaxWsConstants", ".", "TARGETNAMESPACE_ATTRIBUTE", ")", ";", "String", "attrFromAnnotation", "=", "attrValue", "==", "null", "?", "null", ":", "attrValue", ".", "getStringValue", "(", ")", ".", "trim", "(", ")", ";", "return", "StringUtils", ".", "isEmpty", "(", "attrFromAnnotation", ")", "?", "defaultValue", ":", "attrFromAnnotation", ";", "}" ]
get the targetNamespace from implementation bean. if can get the targetNamespace attribute from annotation then return it, otherwise return the package name as default value. Both webService and webServiceprovider has the same logic. @param classInfo @return
[ "get", "the", "targetNamespace", "from", "implementation", "bean", ".", "if", "can", "get", "the", "targetNamespace", "attribute", "from", "annotation", "then", "return", "it", "otherwise", "return", "the", "package", "name", "as", "default", "value", ".", "Both", "webService", "and", "webServiceprovider", "has", "the", "same", "logic", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L197-L211
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getInterfaceTargetNamespace
public static String getInterfaceTargetNamespace(ClassInfo classInfo, String seiClassName, String implementedTargetNamespace, InfoStore infoStore) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); if (annotationInfo == null) { return ""; } boolean isProvider = isProvider(classInfo); // if the serviceImplBean is a WebServiceProvider, return the attribute value or the defaultValue if (isProvider) { AnnotationValue attrValue = annotationInfo.getValue(JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); String attrFromAnnotation = attrValue == null ? null : attrValue.getStringValue().trim(); return StringUtils.isEmpty(attrFromAnnotation) ? implementedTargetNamespace : attrFromAnnotation; } if (null == infoStore || StringUtils.isEmpty(seiClassName)) { return implementedTargetNamespace; } // if can get the SEI className, go here. // Here, the SEI package name instead of implementation class package name should be used as the default value for the targetNameSpace ClassInfo seiClassInfo = infoStore.getDelayableClassInfo(seiClassName); String defaultValue = getNamespace(seiClassInfo, null); if (StringUtils.isEmpty(defaultValue)) { defaultValue = JaxWsConstants.UNKNOWN_NAMESPACE; } annotationInfo = seiClassInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_ANNOTATION_NAME); if (null == annotationInfo) {// if the SEI does not have the @WebService annotation, we should report it as error? (RI 2.2 will do) if (tc.isDebugEnabled()) { Tr.debug(tc, "No @WebService or @WebServiceProvider annotation is found on the class " + seiClassInfo + " will return " + defaultValue); } return defaultValue; } // if the attribute is presented in SEI's @WebService, just return it. or, return the default value for Service String attrFromSEI = annotationInfo.getValue(JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE).getStringValue().trim(); return StringUtils.isEmpty(attrFromSEI) ? defaultValue : attrFromSEI; }
java
public static String getInterfaceTargetNamespace(ClassInfo classInfo, String seiClassName, String implementedTargetNamespace, InfoStore infoStore) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); if (annotationInfo == null) { return ""; } boolean isProvider = isProvider(classInfo); // if the serviceImplBean is a WebServiceProvider, return the attribute value or the defaultValue if (isProvider) { AnnotationValue attrValue = annotationInfo.getValue(JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE); String attrFromAnnotation = attrValue == null ? null : attrValue.getStringValue().trim(); return StringUtils.isEmpty(attrFromAnnotation) ? implementedTargetNamespace : attrFromAnnotation; } if (null == infoStore || StringUtils.isEmpty(seiClassName)) { return implementedTargetNamespace; } // if can get the SEI className, go here. // Here, the SEI package name instead of implementation class package name should be used as the default value for the targetNameSpace ClassInfo seiClassInfo = infoStore.getDelayableClassInfo(seiClassName); String defaultValue = getNamespace(seiClassInfo, null); if (StringUtils.isEmpty(defaultValue)) { defaultValue = JaxWsConstants.UNKNOWN_NAMESPACE; } annotationInfo = seiClassInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_ANNOTATION_NAME); if (null == annotationInfo) {// if the SEI does not have the @WebService annotation, we should report it as error? (RI 2.2 will do) if (tc.isDebugEnabled()) { Tr.debug(tc, "No @WebService or @WebServiceProvider annotation is found on the class " + seiClassInfo + " will return " + defaultValue); } return defaultValue; } // if the attribute is presented in SEI's @WebService, just return it. or, return the default value for Service String attrFromSEI = annotationInfo.getValue(JaxWsConstants.TARGETNAMESPACE_ATTRIBUTE).getStringValue().trim(); return StringUtils.isEmpty(attrFromSEI) ? defaultValue : attrFromSEI; }
[ "public", "static", "String", "getInterfaceTargetNamespace", "(", "ClassInfo", "classInfo", ",", "String", "seiClassName", ",", "String", "implementedTargetNamespace", ",", "InfoStore", "infoStore", ")", "{", "AnnotationInfo", "annotationInfo", "=", "getAnnotationInfoFromClass", "(", "classInfo", ",", "JaxWsConstants", ".", "TARGETNAMESPACE_ATTRIBUTE", ")", ";", "if", "(", "annotationInfo", "==", "null", ")", "{", "return", "\"\"", ";", "}", "boolean", "isProvider", "=", "isProvider", "(", "classInfo", ")", ";", "// if the serviceImplBean is a WebServiceProvider, return the attribute value or the defaultValue", "if", "(", "isProvider", ")", "{", "AnnotationValue", "attrValue", "=", "annotationInfo", ".", "getValue", "(", "JaxWsConstants", ".", "TARGETNAMESPACE_ATTRIBUTE", ")", ";", "String", "attrFromAnnotation", "=", "attrValue", "==", "null", "?", "null", ":", "attrValue", ".", "getStringValue", "(", ")", ".", "trim", "(", ")", ";", "return", "StringUtils", ".", "isEmpty", "(", "attrFromAnnotation", ")", "?", "implementedTargetNamespace", ":", "attrFromAnnotation", ";", "}", "if", "(", "null", "==", "infoStore", "||", "StringUtils", ".", "isEmpty", "(", "seiClassName", ")", ")", "{", "return", "implementedTargetNamespace", ";", "}", "// if can get the SEI className, go here.", "// Here, the SEI package name instead of implementation class package name should be used as the default value for the targetNameSpace", "ClassInfo", "seiClassInfo", "=", "infoStore", ".", "getDelayableClassInfo", "(", "seiClassName", ")", ";", "String", "defaultValue", "=", "getNamespace", "(", "seiClassInfo", ",", "null", ")", ";", "if", "(", "StringUtils", ".", "isEmpty", "(", "defaultValue", ")", ")", "{", "defaultValue", "=", "JaxWsConstants", ".", "UNKNOWN_NAMESPACE", ";", "}", "annotationInfo", "=", "seiClassInfo", ".", "getAnnotation", "(", "JaxWsConstants", ".", "WEB_SERVICE_ANNOTATION_NAME", ")", ";", "if", "(", "null", "==", "annotationInfo", ")", "{", "// if the SEI does not have the @WebService annotation, we should report it as error? (RI 2.2 will do)", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"No @WebService or @WebServiceProvider annotation is found on the class \"", "+", "seiClassInfo", "+", "\" will return \"", "+", "defaultValue", ")", ";", "}", "return", "defaultValue", ";", "}", "// if the attribute is presented in SEI's @WebService, just return it. or, return the default value for Service", "String", "attrFromSEI", "=", "annotationInfo", ".", "getValue", "(", "JaxWsConstants", ".", "TARGETNAMESPACE_ATTRIBUTE", ")", ".", "getStringValue", "(", ")", ".", "trim", "(", ")", ";", "return", "StringUtils", ".", "isEmpty", "(", "attrFromSEI", ")", "?", "defaultValue", ":", "attrFromSEI", ";", "}" ]
get the targetNamespace from SEI. If it is webServiceProvider just return the targetNamespace attribute from annotation. If it is webService and no SEI specified, return the implementedTargetNamespace; If it is webService and SEI specified with no targetNamespace attribute, should report error? If it is webService and SEI specified with targetNamespace attribute, just return the targetNamespace attribute value. @param classInfo @param String @param InfoStore @return
[ "get", "the", "targetNamespace", "from", "SEI", ".", "If", "it", "is", "webServiceProvider", "just", "return", "the", "targetNamespace", "attribute", "from", "annotation", ".", "If", "it", "is", "webService", "and", "no", "SEI", "specified", "return", "the", "implementedTargetNamespace", ";", "If", "it", "is", "webService", "and", "SEI", "specified", "with", "no", "targetNamespace", "attribute", "should", "report", "error?", "If", "it", "is", "webService", "and", "SEI", "specified", "with", "targetNamespace", "attribute", "just", "return", "the", "targetNamespace", "attribute", "value", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L225-L263
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getWSDLLocation
public static String getWSDLLocation(ClassInfo classInfo, String seiClassName, InfoStore infoStore) { return getStringAttributeFromAnnotation(classInfo, seiClassName, infoStore, JaxWsConstants.WSDLLOCATION_ATTRIBUTE, "", ""); }
java
public static String getWSDLLocation(ClassInfo classInfo, String seiClassName, InfoStore infoStore) { return getStringAttributeFromAnnotation(classInfo, seiClassName, infoStore, JaxWsConstants.WSDLLOCATION_ATTRIBUTE, "", ""); }
[ "public", "static", "String", "getWSDLLocation", "(", "ClassInfo", "classInfo", ",", "String", "seiClassName", ",", "InfoStore", "infoStore", ")", "{", "return", "getStringAttributeFromAnnotation", "(", "classInfo", ",", "seiClassName", ",", "infoStore", ",", "JaxWsConstants", ".", "WSDLLOCATION_ATTRIBUTE", ",", "\"\"", ",", "\"\"", ")", ";", "}" ]
First, get the WSDL Location. @param classInfo @param seiClassName @param infoStore @return
[ "First", "get", "the", "WSDL", "Location", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L273-L275
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getStringAttributeFromWebServiceProviderAnnotation
private static String getStringAttributeFromWebServiceProviderAnnotation(AnnotationInfo annotationInfo, String attribute, String defaultForServiceProvider) { //the two values can not be found in webserviceProvider annotation so just return the default value to save time if (attribute.equals(JaxWsConstants.ENDPOINTINTERFACE_ATTRIBUTE) || attribute.equals(JaxWsConstants.NAME_ATTRIBUTE)) { return defaultForServiceProvider; } AnnotationValue attrValue = annotationInfo.getValue(attribute); String attrFromSP = attrValue == null ? null : attrValue.getStringValue().trim(); return StringUtils.isEmpty(attrFromSP) ? defaultForServiceProvider : attrFromSP; }
java
private static String getStringAttributeFromWebServiceProviderAnnotation(AnnotationInfo annotationInfo, String attribute, String defaultForServiceProvider) { //the two values can not be found in webserviceProvider annotation so just return the default value to save time if (attribute.equals(JaxWsConstants.ENDPOINTINTERFACE_ATTRIBUTE) || attribute.equals(JaxWsConstants.NAME_ATTRIBUTE)) { return defaultForServiceProvider; } AnnotationValue attrValue = annotationInfo.getValue(attribute); String attrFromSP = attrValue == null ? null : attrValue.getStringValue().trim(); return StringUtils.isEmpty(attrFromSP) ? defaultForServiceProvider : attrFromSP; }
[ "private", "static", "String", "getStringAttributeFromWebServiceProviderAnnotation", "(", "AnnotationInfo", "annotationInfo", ",", "String", "attribute", ",", "String", "defaultForServiceProvider", ")", "{", "//the two values can not be found in webserviceProvider annotation so just return the default value to save time", "if", "(", "attribute", ".", "equals", "(", "JaxWsConstants", ".", "ENDPOINTINTERFACE_ATTRIBUTE", ")", "||", "attribute", ".", "equals", "(", "JaxWsConstants", ".", "NAME_ATTRIBUTE", ")", ")", "{", "return", "defaultForServiceProvider", ";", "}", "AnnotationValue", "attrValue", "=", "annotationInfo", ".", "getValue", "(", "attribute", ")", ";", "String", "attrFromSP", "=", "attrValue", "==", "null", "?", "null", ":", "attrValue", ".", "getStringValue", "(", ")", ".", "trim", "(", ")", ";", "return", "StringUtils", ".", "isEmpty", "(", "attrFromSP", ")", "?", "defaultForServiceProvider", ":", "attrFromSP", ";", "}" ]
Return the attribute value of WebServiceProvider annotation @param annotationInfo @param attribute @param defaultForServiceProvider @return
[ "Return", "the", "attribute", "value", "of", "WebServiceProvider", "annotation" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L285-L294
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getStringAttributeFromAnnotation
private static String getStringAttributeFromAnnotation(ClassInfo classInfo, String seiClassName, InfoStore infoStore, String attribute, String defaultForService, String defaultForServiceProvider) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, attribute); if (annotationInfo == null) { return ""; } boolean isProvider = isProvider(classInfo); // if the serviceImplBean is a WebServiceProvider, return the attribute value or the defaultValue for ServiceProvider if (isProvider) { return getStringAttributeFromWebServiceProviderAnnotation(annotationInfo, attribute, defaultForServiceProvider); } // if is as WebService, need to get the attribute from itself, the SEI or the interfaces, then the default value for Service String attrFromImplBean = annotationInfo.getValue(attribute).getStringValue().trim(); if (attrFromImplBean.isEmpty()) { // can not get the SEI class name just return the default value if (seiClassName.isEmpty()) { return defaultForService; } else { // if can get the SEI className, go here. ClassInfo seiClassInfo = infoStore.getDelayableClassInfo(seiClassName); annotationInfo = seiClassInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_ANNOTATION_NAME); if (null == annotationInfo) {// if the SEI does not have the @WebService annotation, we should report it as error? (RI 2.2 will do) if (tc.isDebugEnabled()) { Tr.debug(tc, "No @WebService or @WebServiceProvider annotation is found on the class " + seiClassInfo + " will return " + defaultForService); } return defaultForService; } // if the attribute is presented in SEI's @WebService, just return it. or, return the default value for Service String attrFromSEI = annotationInfo.getValue(attribute).getStringValue().trim(); return StringUtils.isEmpty(attrFromSEI) ? defaultForService : attrFromSEI; } } return attrFromImplBean; }
java
private static String getStringAttributeFromAnnotation(ClassInfo classInfo, String seiClassName, InfoStore infoStore, String attribute, String defaultForService, String defaultForServiceProvider) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass(classInfo, attribute); if (annotationInfo == null) { return ""; } boolean isProvider = isProvider(classInfo); // if the serviceImplBean is a WebServiceProvider, return the attribute value or the defaultValue for ServiceProvider if (isProvider) { return getStringAttributeFromWebServiceProviderAnnotation(annotationInfo, attribute, defaultForServiceProvider); } // if is as WebService, need to get the attribute from itself, the SEI or the interfaces, then the default value for Service String attrFromImplBean = annotationInfo.getValue(attribute).getStringValue().trim(); if (attrFromImplBean.isEmpty()) { // can not get the SEI class name just return the default value if (seiClassName.isEmpty()) { return defaultForService; } else { // if can get the SEI className, go here. ClassInfo seiClassInfo = infoStore.getDelayableClassInfo(seiClassName); annotationInfo = seiClassInfo.getAnnotation(JaxWsConstants.WEB_SERVICE_ANNOTATION_NAME); if (null == annotationInfo) {// if the SEI does not have the @WebService annotation, we should report it as error? (RI 2.2 will do) if (tc.isDebugEnabled()) { Tr.debug(tc, "No @WebService or @WebServiceProvider annotation is found on the class " + seiClassInfo + " will return " + defaultForService); } return defaultForService; } // if the attribute is presented in SEI's @WebService, just return it. or, return the default value for Service String attrFromSEI = annotationInfo.getValue(attribute).getStringValue().trim(); return StringUtils.isEmpty(attrFromSEI) ? defaultForService : attrFromSEI; } } return attrFromImplBean; }
[ "private", "static", "String", "getStringAttributeFromAnnotation", "(", "ClassInfo", "classInfo", ",", "String", "seiClassName", ",", "InfoStore", "infoStore", ",", "String", "attribute", ",", "String", "defaultForService", ",", "String", "defaultForServiceProvider", ")", "{", "AnnotationInfo", "annotationInfo", "=", "getAnnotationInfoFromClass", "(", "classInfo", ",", "attribute", ")", ";", "if", "(", "annotationInfo", "==", "null", ")", "{", "return", "\"\"", ";", "}", "boolean", "isProvider", "=", "isProvider", "(", "classInfo", ")", ";", "// if the serviceImplBean is a WebServiceProvider, return the attribute value or the defaultValue for ServiceProvider", "if", "(", "isProvider", ")", "{", "return", "getStringAttributeFromWebServiceProviderAnnotation", "(", "annotationInfo", ",", "attribute", ",", "defaultForServiceProvider", ")", ";", "}", "// if is as WebService, need to get the attribute from itself, the SEI or the interfaces, then the default value for Service", "String", "attrFromImplBean", "=", "annotationInfo", ".", "getValue", "(", "attribute", ")", ".", "getStringValue", "(", ")", ".", "trim", "(", ")", ";", "if", "(", "attrFromImplBean", ".", "isEmpty", "(", ")", ")", "{", "// can not get the SEI class name just return the default value", "if", "(", "seiClassName", ".", "isEmpty", "(", ")", ")", "{", "return", "defaultForService", ";", "}", "else", "{", "// if can get the SEI className, go here.", "ClassInfo", "seiClassInfo", "=", "infoStore", ".", "getDelayableClassInfo", "(", "seiClassName", ")", ";", "annotationInfo", "=", "seiClassInfo", ".", "getAnnotation", "(", "JaxWsConstants", ".", "WEB_SERVICE_ANNOTATION_NAME", ")", ";", "if", "(", "null", "==", "annotationInfo", ")", "{", "// if the SEI does not have the @WebService annotation, we should report it as error? (RI 2.2 will do)", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"No @WebService or @WebServiceProvider annotation is found on the class \"", "+", "seiClassInfo", "+", "\" will return \"", "+", "defaultForService", ")", ";", "}", "return", "defaultForService", ";", "}", "// if the attribute is presented in SEI's @WebService, just return it. or, return the default value for Service", "String", "attrFromSEI", "=", "annotationInfo", ".", "getValue", "(", "attribute", ")", ".", "getStringValue", "(", ")", ".", "trim", "(", ")", ";", "return", "StringUtils", ".", "isEmpty", "(", "attrFromSEI", ")", "?", "defaultForService", ":", "attrFromSEI", ";", "}", "}", "return", "attrFromImplBean", ";", "}" ]
Get the string value of attribute in WebService or WebserviceProvider annotation. If it is provider, get the attribute from its annotation. If it is not provider, First, try to get the attribute from serviceImplBean, then, try to get the attribute from the SEI either from seiClassName or "endpointInterface" attribute, finally, return the defaultForService if is the WebService annotation, or defaultForServiceProvider for WebServiceProvider annotation. If could not find neither the WebService or WebServiceProvider annotation, just return an empty string. @param classInfo @param seiClassName @param infoStore @param attribute @param defaultForService @param defaultForServiceProvider @return
[ "Get", "the", "string", "value", "of", "attribute", "in", "WebService", "or", "WebserviceProvider", "annotation", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L315-L354
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getPortComponentName
public static String getPortComponentName(ClassInfo classInfo, String seiClassName, InfoStore infoStore) { String defaultForServiceProvider = classInfo.getName(); String defaultForService = getClassName(classInfo.getName()); return getStringAttributeFromAnnotation(classInfo, seiClassName, infoStore, JaxWsConstants.NAME_ATTRIBUTE, defaultForService, defaultForServiceProvider); }
java
public static String getPortComponentName(ClassInfo classInfo, String seiClassName, InfoStore infoStore) { String defaultForServiceProvider = classInfo.getName(); String defaultForService = getClassName(classInfo.getName()); return getStringAttributeFromAnnotation(classInfo, seiClassName, infoStore, JaxWsConstants.NAME_ATTRIBUTE, defaultForService, defaultForServiceProvider); }
[ "public", "static", "String", "getPortComponentName", "(", "ClassInfo", "classInfo", ",", "String", "seiClassName", ",", "InfoStore", "infoStore", ")", "{", "String", "defaultForServiceProvider", "=", "classInfo", ".", "getName", "(", ")", ";", "String", "defaultForService", "=", "getClassName", "(", "classInfo", ".", "getName", "(", ")", ")", ";", "return", "getStringAttributeFromAnnotation", "(", "classInfo", ",", "seiClassName", ",", "infoStore", ",", "JaxWsConstants", ".", "NAME_ATTRIBUTE", ",", "defaultForService", ",", "defaultForServiceProvider", ")", ";", "}" ]
Get the portComponentName from ClassInfo @param classInfo @return
[ "Get", "the", "portComponentName", "from", "ClassInfo" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L372-L376
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getPortQName
private static QName getPortQName(ClassInfo classInfo, String namespace, String wsName, String wsPortName, String suffix) { String portName; if (wsPortName != null && !wsPortName.isEmpty()) { portName = wsPortName.trim(); } else { if (wsName != null && !wsName.isEmpty()) { portName = wsName.trim(); } else { String qualifiedName = classInfo.getQualifiedName(); int lastDotIndex = qualifiedName.lastIndexOf("."); portName = (lastDotIndex == -1 ? qualifiedName : qualifiedName.substring(lastDotIndex + 1)); } portName = portName + suffix; } return new QName(namespace, portName); }
java
private static QName getPortQName(ClassInfo classInfo, String namespace, String wsName, String wsPortName, String suffix) { String portName; if (wsPortName != null && !wsPortName.isEmpty()) { portName = wsPortName.trim(); } else { if (wsName != null && !wsName.isEmpty()) { portName = wsName.trim(); } else { String qualifiedName = classInfo.getQualifiedName(); int lastDotIndex = qualifiedName.lastIndexOf("."); portName = (lastDotIndex == -1 ? qualifiedName : qualifiedName.substring(lastDotIndex + 1)); } portName = portName + suffix; } return new QName(namespace, portName); }
[ "private", "static", "QName", "getPortQName", "(", "ClassInfo", "classInfo", ",", "String", "namespace", ",", "String", "wsName", ",", "String", "wsPortName", ",", "String", "suffix", ")", "{", "String", "portName", ";", "if", "(", "wsPortName", "!=", "null", "&&", "!", "wsPortName", ".", "isEmpty", "(", ")", ")", "{", "portName", "=", "wsPortName", ".", "trim", "(", ")", ";", "}", "else", "{", "if", "(", "wsName", "!=", "null", "&&", "!", "wsName", ".", "isEmpty", "(", ")", ")", "{", "portName", "=", "wsName", ".", "trim", "(", ")", ";", "}", "else", "{", "String", "qualifiedName", "=", "classInfo", ".", "getQualifiedName", "(", ")", ";", "int", "lastDotIndex", "=", "qualifiedName", ".", "lastIndexOf", "(", "\".\"", ")", ";", "portName", "=", "(", "lastDotIndex", "==", "-", "1", "?", "qualifiedName", ":", "qualifiedName", ".", "substring", "(", "lastDotIndex", "+", "1", ")", ")", ";", "}", "portName", "=", "portName", "+", "suffix", ";", "}", "return", "new", "QName", "(", "namespace", ",", "portName", ")", ";", "}" ]
Get portName. 1.declared portName in web service annotation 2.name in web service annotation + Port 3.service class name + Port. From specification: The portName element of the WebService annotation, if present, MUST be used to derive the port name to use in WSDL. In the absence of a portName element, an implementation MUST use the value of the name element of the WebService annotation, if present, suffixed with “Port”. Otherwise, an implementation MUST use the simple name of the class annotated with WebService suffixed with “Port”. @param classInfo @param namespace @param wsPortName @param suffix @return
[ "Get", "portName", ".", "1", ".", "declared", "portName", "in", "web", "service", "annotation", "2", ".", "name", "in", "web", "service", "annotation", "+", "Port", "3", ".", "service", "class", "name", "+", "Port", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L407-L422
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.matchesQName
public static boolean matchesQName(QName regQName, QName targetQName, boolean ignorePrefix) { if (regQName == null || targetQName == null) { return false; } if ("*".equals(getQNameString(regQName))) { return true; } // if the name space or the prefix is not equal, just return false; if (!(regQName.getNamespaceURI().equals(targetQName.getNamespaceURI())) || !(ignorePrefix || regQName.getPrefix().equals(targetQName.getPrefix()))) { return false; } if (regQName.getLocalPart().contains("*")) { return Pattern.matches(mapPattern(regQName.getLocalPart()), targetQName.getLocalPart()); } else if (regQName.getLocalPart().equals(targetQName.getLocalPart())) { return true; } return false; }
java
public static boolean matchesQName(QName regQName, QName targetQName, boolean ignorePrefix) { if (regQName == null || targetQName == null) { return false; } if ("*".equals(getQNameString(regQName))) { return true; } // if the name space or the prefix is not equal, just return false; if (!(regQName.getNamespaceURI().equals(targetQName.getNamespaceURI())) || !(ignorePrefix || regQName.getPrefix().equals(targetQName.getPrefix()))) { return false; } if (regQName.getLocalPart().contains("*")) { return Pattern.matches(mapPattern(regQName.getLocalPart()), targetQName.getLocalPart()); } else if (regQName.getLocalPart().equals(targetQName.getLocalPart())) { return true; } return false; }
[ "public", "static", "boolean", "matchesQName", "(", "QName", "regQName", ",", "QName", "targetQName", ",", "boolean", "ignorePrefix", ")", "{", "if", "(", "regQName", "==", "null", "||", "targetQName", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "\"*\"", ".", "equals", "(", "getQNameString", "(", "regQName", ")", ")", ")", "{", "return", "true", ";", "}", "// if the name space or the prefix is not equal, just return false;", "if", "(", "!", "(", "regQName", ".", "getNamespaceURI", "(", ")", ".", "equals", "(", "targetQName", ".", "getNamespaceURI", "(", ")", ")", ")", "||", "!", "(", "ignorePrefix", "||", "regQName", ".", "getPrefix", "(", ")", ".", "equals", "(", "targetQName", ".", "getPrefix", "(", ")", ")", ")", ")", "{", "return", "false", ";", "}", "if", "(", "regQName", ".", "getLocalPart", "(", ")", ".", "contains", "(", "\"*\"", ")", ")", "{", "return", "Pattern", ".", "matches", "(", "mapPattern", "(", "regQName", ".", "getLocalPart", "(", ")", ")", ",", "targetQName", ".", "getLocalPart", "(", ")", ")", ";", "}", "else", "if", "(", "regQName", ".", "getLocalPart", "(", ")", ".", "equals", "(", "targetQName", ".", "getLocalPart", "(", ")", ")", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
Check whether the regQName matches the targetQName Only the localPart of the regQName supports the * match, it means only the name space and prefix is all matched, then the localPart will be compared considering the * When the ignorePrefix is true, the prefix will be ignored. @param regQName @param targetQName @param ignorePrefix @return
[ "Check", "whether", "the", "regQName", "matches", "the", "targetQName" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L490-L509
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java
JaxWsUtils.getProtocolByToken
public static String getProtocolByToken(String token, boolean returnDefault) { if (StringUtils.isEmpty(token) && returnDefault) { return JaxWsConstants.SOAP11HTTP_BINDING; } if (JaxWsConstants.SOAP11_HTTP_TOKEN.equals(token)) { return JaxWsConstants.SOAP11HTTP_BINDING; } else if (JaxWsConstants.SOAP11_HTTP_MTOM_TOKEN.equals(token)) { return JaxWsConstants.SOAP11HTTP_MTOM_BINDING; } else if (JaxWsConstants.SOAP12_HTTP_TOKEN.equals(token)) { return JaxWsConstants.SOAP12HTTP_BINDING; } else if (JaxWsConstants.SOAP12_HTTP_MTOM_TOKEN.equals(token)) { return JaxWsConstants.SOAP12HTTP_MTOM_BINDING; } else if (JaxWsConstants.XML_HTTP_TOKEN.equals(token)) { return JaxWsConstants.HTTP_BINDING; } else { return token; } }
java
public static String getProtocolByToken(String token, boolean returnDefault) { if (StringUtils.isEmpty(token) && returnDefault) { return JaxWsConstants.SOAP11HTTP_BINDING; } if (JaxWsConstants.SOAP11_HTTP_TOKEN.equals(token)) { return JaxWsConstants.SOAP11HTTP_BINDING; } else if (JaxWsConstants.SOAP11_HTTP_MTOM_TOKEN.equals(token)) { return JaxWsConstants.SOAP11HTTP_MTOM_BINDING; } else if (JaxWsConstants.SOAP12_HTTP_TOKEN.equals(token)) { return JaxWsConstants.SOAP12HTTP_BINDING; } else if (JaxWsConstants.SOAP12_HTTP_MTOM_TOKEN.equals(token)) { return JaxWsConstants.SOAP12HTTP_MTOM_BINDING; } else if (JaxWsConstants.XML_HTTP_TOKEN.equals(token)) { return JaxWsConstants.HTTP_BINDING; } else { return token; } }
[ "public", "static", "String", "getProtocolByToken", "(", "String", "token", ",", "boolean", "returnDefault", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "token", ")", "&&", "returnDefault", ")", "{", "return", "JaxWsConstants", ".", "SOAP11HTTP_BINDING", ";", "}", "if", "(", "JaxWsConstants", ".", "SOAP11_HTTP_TOKEN", ".", "equals", "(", "token", ")", ")", "{", "return", "JaxWsConstants", ".", "SOAP11HTTP_BINDING", ";", "}", "else", "if", "(", "JaxWsConstants", ".", "SOAP11_HTTP_MTOM_TOKEN", ".", "equals", "(", "token", ")", ")", "{", "return", "JaxWsConstants", ".", "SOAP11HTTP_MTOM_BINDING", ";", "}", "else", "if", "(", "JaxWsConstants", ".", "SOAP12_HTTP_TOKEN", ".", "equals", "(", "token", ")", ")", "{", "return", "JaxWsConstants", ".", "SOAP12HTTP_BINDING", ";", "}", "else", "if", "(", "JaxWsConstants", ".", "SOAP12_HTTP_MTOM_TOKEN", ".", "equals", "(", "token", ")", ")", "{", "return", "JaxWsConstants", ".", "SOAP12HTTP_MTOM_BINDING", ";", "}", "else", "if", "(", "JaxWsConstants", ".", "XML_HTTP_TOKEN", ".", "equals", "(", "token", ")", ")", "{", "return", "JaxWsConstants", ".", "HTTP_BINDING", ";", "}", "else", "{", "return", "token", ";", "}", "}" ]
Get the protocol by token @param token @param returnDefault if true and the token is an empty String or null, return SOAPBinding.SOAP11HTTP_BINDING. @return
[ "Get", "the", "protocol", "by", "token" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/utils/JaxWsUtils.java#L634-L652
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/RRSGlobalTransactionWrapper.java
RRSGlobalTransactionWrapper.addSync
@Override public boolean addSync() throws ResourceException { if (tc.isEntryEnabled()) { Tr.entry(this, tc, "addSync"); } UOWCoordinator uowCoord = mcWrapper.getUOWCoordinator(); if (uowCoord == null) { IllegalStateException e = new IllegalStateException("addSync: illegal state exception. uowCoord is null"); Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", "addSync", e); if (tc.isEntryEnabled()) Tr.exit(this, tc, "addSync", e); throw e; } try { // added a second synchronization // // RRS Transactions don't follow the XA model, and therefore don't receive callbacks for // end, prepare, and commit/rollback. Defect added State Management for RRS // controlled transactions, and because the state on the adapter is, for XA transactions, // reset during the commit callback, we need to reset the adapter state as close as // possible after the commit time. Therefore, we need to register as a priority sync // for the purpose of resetting the adapter state. We need to also register as a normal // sync, however, because we have additional afterCompletion code that returns the // managed connection to the free pool. This code must be executed AFTER DB2 gets its // afterCompletion callback. DB2 is also registered as a priority sync, and since we // can't guarantee the order of the afterCompletion callbacks if two syncs are registered // as priority, we need to register as a regular sync to execute this part of the code. EmbeddableWebSphereTransactionManager tranMgr = mcWrapper.pm.connectorSvc.transactionManager; tranMgr.registerSynchronization(uowCoord, this); final ManagedConnection mc = mcWrapper.getManagedConnection(); // Registering a synchronization object with priority SYNC_TIER_RRS (3) allows the // synchronization to be called last. if (mc instanceof WSManagedConnection) { tranMgr.registerSynchronization( uowCoord, new Synchronization() { @Override public void beforeCompletion() { } @Override public void afterCompletion(int status) { ((WSManagedConnection) mc).afterCompletionRRS(); } }, RegisteredSyncs.SYNC_TIER_RRS ); } } catch (Exception e) { com.ibm.ws.ffdc.FFDCFilter.processException( e, "com.ibm.ejs.j2c.RRSGlobalTransactionWrapper.addSync", "238", this); Tr.error(tc, "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026", "addSync", e, "ResourceException"); ResourceException re = new ResourceException("addSync: caught Exception"); re.initCause(e); if (tc.isEntryEnabled()) Tr.exit(this, tc, "addSync", e); throw re; } if (tc.isEntryEnabled()) { Tr.exit(this, tc, "addSync", true); } return true; }
java
@Override public boolean addSync() throws ResourceException { if (tc.isEntryEnabled()) { Tr.entry(this, tc, "addSync"); } UOWCoordinator uowCoord = mcWrapper.getUOWCoordinator(); if (uowCoord == null) { IllegalStateException e = new IllegalStateException("addSync: illegal state exception. uowCoord is null"); Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", "addSync", e); if (tc.isEntryEnabled()) Tr.exit(this, tc, "addSync", e); throw e; } try { // added a second synchronization // // RRS Transactions don't follow the XA model, and therefore don't receive callbacks for // end, prepare, and commit/rollback. Defect added State Management for RRS // controlled transactions, and because the state on the adapter is, for XA transactions, // reset during the commit callback, we need to reset the adapter state as close as // possible after the commit time. Therefore, we need to register as a priority sync // for the purpose of resetting the adapter state. We need to also register as a normal // sync, however, because we have additional afterCompletion code that returns the // managed connection to the free pool. This code must be executed AFTER DB2 gets its // afterCompletion callback. DB2 is also registered as a priority sync, and since we // can't guarantee the order of the afterCompletion callbacks if two syncs are registered // as priority, we need to register as a regular sync to execute this part of the code. EmbeddableWebSphereTransactionManager tranMgr = mcWrapper.pm.connectorSvc.transactionManager; tranMgr.registerSynchronization(uowCoord, this); final ManagedConnection mc = mcWrapper.getManagedConnection(); // Registering a synchronization object with priority SYNC_TIER_RRS (3) allows the // synchronization to be called last. if (mc instanceof WSManagedConnection) { tranMgr.registerSynchronization( uowCoord, new Synchronization() { @Override public void beforeCompletion() { } @Override public void afterCompletion(int status) { ((WSManagedConnection) mc).afterCompletionRRS(); } }, RegisteredSyncs.SYNC_TIER_RRS ); } } catch (Exception e) { com.ibm.ws.ffdc.FFDCFilter.processException( e, "com.ibm.ejs.j2c.RRSGlobalTransactionWrapper.addSync", "238", this); Tr.error(tc, "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026", "addSync", e, "ResourceException"); ResourceException re = new ResourceException("addSync: caught Exception"); re.initCause(e); if (tc.isEntryEnabled()) Tr.exit(this, tc, "addSync", e); throw re; } if (tc.isEntryEnabled()) { Tr.exit(this, tc, "addSync", true); } return true; }
[ "@", "Override", "public", "boolean", "addSync", "(", ")", "throws", "ResourceException", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "this", ",", "tc", ",", "\"addSync\"", ")", ";", "}", "UOWCoordinator", "uowCoord", "=", "mcWrapper", ".", "getUOWCoordinator", "(", ")", ";", "if", "(", "uowCoord", "==", "null", ")", "{", "IllegalStateException", "e", "=", "new", "IllegalStateException", "(", "\"addSync: illegal state exception. uowCoord is null\"", ")", ";", "Tr", ".", "error", "(", "tc", ",", "\"ILLEGAL_STATE_EXCEPTION_J2CA0079\"", ",", "\"addSync\"", ",", "e", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "this", ",", "tc", ",", "\"addSync\"", ",", "e", ")", ";", "throw", "e", ";", "}", "try", "{", "// added a second synchronization", "//", "// RRS Transactions don't follow the XA model, and therefore don't receive callbacks for", "// end, prepare, and commit/rollback. Defect added State Management for RRS", "// controlled transactions, and because the state on the adapter is, for XA transactions,", "// reset during the commit callback, we need to reset the adapter state as close as", "// possible after the commit time. Therefore, we need to register as a priority sync", "// for the purpose of resetting the adapter state. We need to also register as a normal", "// sync, however, because we have additional afterCompletion code that returns the", "// managed connection to the free pool. This code must be executed AFTER DB2 gets its", "// afterCompletion callback. DB2 is also registered as a priority sync, and since we", "// can't guarantee the order of the afterCompletion callbacks if two syncs are registered", "// as priority, we need to register as a regular sync to execute this part of the code.", "EmbeddableWebSphereTransactionManager", "tranMgr", "=", "mcWrapper", ".", "pm", ".", "connectorSvc", ".", "transactionManager", ";", "tranMgr", ".", "registerSynchronization", "(", "uowCoord", ",", "this", ")", ";", "final", "ManagedConnection", "mc", "=", "mcWrapper", ".", "getManagedConnection", "(", ")", ";", "// Registering a synchronization object with priority SYNC_TIER_RRS (3) allows the", "// synchronization to be called last.", "if", "(", "mc", "instanceof", "WSManagedConnection", ")", "{", "tranMgr", ".", "registerSynchronization", "(", "uowCoord", ",", "new", "Synchronization", "(", ")", "{", "@", "Override", "public", "void", "beforeCompletion", "(", ")", "{", "}", "@", "Override", "public", "void", "afterCompletion", "(", "int", "status", ")", "{", "(", "(", "WSManagedConnection", ")", "mc", ")", ".", "afterCompletionRRS", "(", ")", ";", "}", "}", ",", "RegisteredSyncs", ".", "SYNC_TIER_RRS", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ejs.j2c.RRSGlobalTransactionWrapper.addSync\"", ",", "\"238\"", ",", "this", ")", ";", "Tr", ".", "error", "(", "tc", ",", "\"REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026\"", ",", "\"addSync\"", ",", "e", ",", "\"ResourceException\"", ")", ";", "ResourceException", "re", "=", "new", "ResourceException", "(", "\"addSync: caught Exception\"", ")", ";", "re", ".", "initCause", "(", "e", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "this", ",", "tc", ",", "\"addSync\"", ",", "e", ")", ";", "throw", "re", ";", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "this", ",", "tc", ",", "\"addSync\"", ",", "true", ")", ";", "}", "return", "true", ";", "}" ]
Register the RRSGlobalTransactionWrapper as a sync object with the Transaction Manager for the current transaction. @throws ResourceException. @return boolean
[ "Register", "the", "RRSGlobalTransactionWrapper", "as", "a", "sync", "object", "with", "the", "Transaction", "Manager", "for", "the", "current", "transaction", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/RRSGlobalTransactionWrapper.java#L112-L186
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskPropertyHandler.java
FileStatusTaskPropertyHandler.taskProperties
private void taskProperties(RESTRequest request, RESTResponse response) { String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID); String taskPropertiesText = getMultipleRoutingHelper().getTaskProperties(taskID); OutputHelper.writeTextOutput(response, taskPropertiesText); }
java
private void taskProperties(RESTRequest request, RESTResponse response) { String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID); String taskPropertiesText = getMultipleRoutingHelper().getTaskProperties(taskID); OutputHelper.writeTextOutput(response, taskPropertiesText); }
[ "private", "void", "taskProperties", "(", "RESTRequest", "request", ",", "RESTResponse", "response", ")", "{", "String", "taskID", "=", "RESTHelper", ".", "getRequiredParam", "(", "request", ",", "APIConstants", ".", "PARAM_TASK_ID", ")", ";", "String", "taskPropertiesText", "=", "getMultipleRoutingHelper", "(", ")", ".", "getTaskProperties", "(", "taskID", ")", ";", "OutputHelper", ".", "writeTextOutput", "(", "response", ",", "taskPropertiesText", ")", ";", "}" ]
Returns the list of available properties and their corresponding URLs.
[ "Returns", "the", "list", "of", "available", "properties", "and", "their", "corresponding", "URLs", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskPropertyHandler.java#L86-L91
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskPropertyHandler.java
FileStatusTaskPropertyHandler.taskProperty
private void taskProperty(RESTRequest request, RESTResponse response) { String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID); String property = RESTHelper.getRequiredParam(request, APIConstants.PARAM_PROPERTY); String taskPropertyText = getMultipleRoutingHelper().getTaskProperty(taskID, property); OutputHelper.writeTextOutput(response, taskPropertyText); }
java
private void taskProperty(RESTRequest request, RESTResponse response) { String taskID = RESTHelper.getRequiredParam(request, APIConstants.PARAM_TASK_ID); String property = RESTHelper.getRequiredParam(request, APIConstants.PARAM_PROPERTY); String taskPropertyText = getMultipleRoutingHelper().getTaskProperty(taskID, property); OutputHelper.writeTextOutput(response, taskPropertyText); }
[ "private", "void", "taskProperty", "(", "RESTRequest", "request", ",", "RESTResponse", "response", ")", "{", "String", "taskID", "=", "RESTHelper", ".", "getRequiredParam", "(", "request", ",", "APIConstants", ".", "PARAM_TASK_ID", ")", ";", "String", "property", "=", "RESTHelper", ".", "getRequiredParam", "(", "request", ",", "APIConstants", ".", "PARAM_PROPERTY", ")", ";", "String", "taskPropertyText", "=", "getMultipleRoutingHelper", "(", ")", ".", "getTaskProperty", "(", "taskID", ",", "property", ")", ";", "OutputHelper", ".", "writeTextOutput", "(", "response", ",", "taskPropertyText", ")", ";", "}" ]
Returns the value of the property. An IllegalArgument exception is thrown if the value is not an instance of java.lang.String.
[ "Returns", "the", "value", "of", "the", "property", ".", "An", "IllegalArgument", "exception", "is", "thrown", "if", "the", "value", "is", "not", "an", "instance", "of", "java", ".", "lang", ".", "String", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/handlers/FileStatusTaskPropertyHandler.java#L97-L103
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/DERUTF8String.java
DERUTF8String.getInstance
public static DERUTF8String getInstance( Object obj) { if (obj == null || obj instanceof DERUTF8String) { return (DERUTF8String)obj; } if (obj instanceof ASN1OctetString) { return new DERUTF8String(((ASN1OctetString)obj).getOctets()); } if (obj instanceof ASN1TaggedObject) { return getInstance(((ASN1TaggedObject)obj).getObject()); } throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName()); }
java
public static DERUTF8String getInstance( Object obj) { if (obj == null || obj instanceof DERUTF8String) { return (DERUTF8String)obj; } if (obj instanceof ASN1OctetString) { return new DERUTF8String(((ASN1OctetString)obj).getOctets()); } if (obj instanceof ASN1TaggedObject) { return getInstance(((ASN1TaggedObject)obj).getObject()); } throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName()); }
[ "public", "static", "DERUTF8String", "getInstance", "(", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", "||", "obj", "instanceof", "DERUTF8String", ")", "{", "return", "(", "DERUTF8String", ")", "obj", ";", "}", "if", "(", "obj", "instanceof", "ASN1OctetString", ")", "{", "return", "new", "DERUTF8String", "(", "(", "(", "ASN1OctetString", ")", "obj", ")", ".", "getOctets", "(", ")", ")", ";", "}", "if", "(", "obj", "instanceof", "ASN1TaggedObject", ")", "{", "return", "getInstance", "(", "(", "(", "ASN1TaggedObject", ")", "obj", ")", ".", "getObject", "(", ")", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "\"illegal object in getInstance: \"", "+", "obj", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}" ]
return an UTF8 string from the passed in object. @exception IllegalArgumentException if the object cannot be converted.
[ "return", "an", "UTF8", "string", "from", "the", "passed", "in", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/DERUTF8String.java#L34-L53
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java
SibRaEngineComponent.registerMessagingEngineListener
public static JsMessagingEngine[] registerMessagingEngineListener( final SibRaMessagingEngineListener listener, final String busName) { final String methodName = "registerMessagingEngineListener"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, new Object[] { listener, busName }); } final Set activeMessagingEngines = new HashSet(); /* * Take lock on active messaging engines to ensure that the activation * of a messaging engine is reported once and once only either in the * array returned from this method or by notification to the listener. */ synchronized (ACTIVE_MESSAGING_ENGINES) { synchronized (MESSAGING_ENGINE_LISTENERS) { // Add listener to map Set listeners = (Set) MESSAGING_ENGINE_LISTENERS.get(busName); if (listeners == null) { listeners = new HashSet(); MESSAGING_ENGINE_LISTENERS.put(busName, listeners); } listeners.add(listener); } if (busName == null) { // Add all of the currently active messaging engines for (final Iterator iterator = ACTIVE_MESSAGING_ENGINES .values().iterator(); iterator.hasNext();) { final Set messagingEngines = (Set) iterator.next(); activeMessagingEngines.addAll(messagingEngines); } } else { // Add active messaging engines for the given bus if any final Set messagingEngines = (Set) ACTIVE_MESSAGING_ENGINES .get(busName); if (messagingEngines != null) { activeMessagingEngines.addAll(messagingEngines); } } } final JsMessagingEngine[] result = (JsMessagingEngine[]) activeMessagingEngines .toArray(new JsMessagingEngine[activeMessagingEngines.size()]); if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName, result); } return result; }
java
public static JsMessagingEngine[] registerMessagingEngineListener( final SibRaMessagingEngineListener listener, final String busName) { final String methodName = "registerMessagingEngineListener"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, new Object[] { listener, busName }); } final Set activeMessagingEngines = new HashSet(); /* * Take lock on active messaging engines to ensure that the activation * of a messaging engine is reported once and once only either in the * array returned from this method or by notification to the listener. */ synchronized (ACTIVE_MESSAGING_ENGINES) { synchronized (MESSAGING_ENGINE_LISTENERS) { // Add listener to map Set listeners = (Set) MESSAGING_ENGINE_LISTENERS.get(busName); if (listeners == null) { listeners = new HashSet(); MESSAGING_ENGINE_LISTENERS.put(busName, listeners); } listeners.add(listener); } if (busName == null) { // Add all of the currently active messaging engines for (final Iterator iterator = ACTIVE_MESSAGING_ENGINES .values().iterator(); iterator.hasNext();) { final Set messagingEngines = (Set) iterator.next(); activeMessagingEngines.addAll(messagingEngines); } } else { // Add active messaging engines for the given bus if any final Set messagingEngines = (Set) ACTIVE_MESSAGING_ENGINES .get(busName); if (messagingEngines != null) { activeMessagingEngines.addAll(messagingEngines); } } } final JsMessagingEngine[] result = (JsMessagingEngine[]) activeMessagingEngines .toArray(new JsMessagingEngine[activeMessagingEngines.size()]); if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName, result); } return result; }
[ "public", "static", "JsMessagingEngine", "[", "]", "registerMessagingEngineListener", "(", "final", "SibRaMessagingEngineListener", "listener", ",", "final", "String", "busName", ")", "{", "final", "String", "methodName", "=", "\"registerMessagingEngineListener\"", ";", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "TRACE", ",", "methodName", ",", "new", "Object", "[", "]", "{", "listener", ",", "busName", "}", ")", ";", "}", "final", "Set", "activeMessagingEngines", "=", "new", "HashSet", "(", ")", ";", "/*\n * Take lock on active messaging engines to ensure that the activation\n * of a messaging engine is reported once and once only either in the\n * array returned from this method or by notification to the listener.\n */", "synchronized", "(", "ACTIVE_MESSAGING_ENGINES", ")", "{", "synchronized", "(", "MESSAGING_ENGINE_LISTENERS", ")", "{", "// Add listener to map", "Set", "listeners", "=", "(", "Set", ")", "MESSAGING_ENGINE_LISTENERS", ".", "get", "(", "busName", ")", ";", "if", "(", "listeners", "==", "null", ")", "{", "listeners", "=", "new", "HashSet", "(", ")", ";", "MESSAGING_ENGINE_LISTENERS", ".", "put", "(", "busName", ",", "listeners", ")", ";", "}", "listeners", ".", "add", "(", "listener", ")", ";", "}", "if", "(", "busName", "==", "null", ")", "{", "// Add all of the currently active messaging engines", "for", "(", "final", "Iterator", "iterator", "=", "ACTIVE_MESSAGING_ENGINES", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "final", "Set", "messagingEngines", "=", "(", "Set", ")", "iterator", ".", "next", "(", ")", ";", "activeMessagingEngines", ".", "addAll", "(", "messagingEngines", ")", ";", "}", "}", "else", "{", "// Add active messaging engines for the given bus if any", "final", "Set", "messagingEngines", "=", "(", "Set", ")", "ACTIVE_MESSAGING_ENGINES", ".", "get", "(", "busName", ")", ";", "if", "(", "messagingEngines", "!=", "null", ")", "{", "activeMessagingEngines", ".", "addAll", "(", "messagingEngines", ")", ";", "}", "}", "}", "final", "JsMessagingEngine", "[", "]", "result", "=", "(", "JsMessagingEngine", "[", "]", ")", "activeMessagingEngines", ".", "toArray", "(", "new", "JsMessagingEngine", "[", "activeMessagingEngines", ".", "size", "(", ")", "]", ")", ";", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "TRACE", ",", "methodName", ",", "result", ")", ";", "}", "return", "result", ";", "}" ]
Registers a listener for active messaging engines on a bus. @param listener the listener to register @param busName the name of the bus the listener wishes to be informed about messaging engines for or <code>null</code> if it wishes to know about all messaging engines @return an array of the currently active messaging engines or an empty array if there are none
[ "Registers", "a", "listener", "for", "active", "messaging", "engines", "on", "a", "bus", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java#L95-L157
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java
SibRaEngineComponent.deregisterMessagingEngineListener
public static void deregisterMessagingEngineListener( final SibRaMessagingEngineListener listener, final String busName) { final String methodName = "deregisterMessagingEngineListener"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, new Object[] { listener, busName }); } synchronized (MESSAGING_ENGINE_LISTENERS) { final Set listeners = (Set) MESSAGING_ENGINE_LISTENERS.get(busName); if (listeners != null) { listeners.remove(listener); if (listeners.isEmpty()) { MESSAGING_ENGINE_LISTENERS.remove(busName); } } } if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName); } }
java
public static void deregisterMessagingEngineListener( final SibRaMessagingEngineListener listener, final String busName) { final String methodName = "deregisterMessagingEngineListener"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, new Object[] { listener, busName }); } synchronized (MESSAGING_ENGINE_LISTENERS) { final Set listeners = (Set) MESSAGING_ENGINE_LISTENERS.get(busName); if (listeners != null) { listeners.remove(listener); if (listeners.isEmpty()) { MESSAGING_ENGINE_LISTENERS.remove(busName); } } } if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName); } }
[ "public", "static", "void", "deregisterMessagingEngineListener", "(", "final", "SibRaMessagingEngineListener", "listener", ",", "final", "String", "busName", ")", "{", "final", "String", "methodName", "=", "\"deregisterMessagingEngineListener\"", ";", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "TRACE", ",", "methodName", ",", "new", "Object", "[", "]", "{", "listener", ",", "busName", "}", ")", ";", "}", "synchronized", "(", "MESSAGING_ENGINE_LISTENERS", ")", "{", "final", "Set", "listeners", "=", "(", "Set", ")", "MESSAGING_ENGINE_LISTENERS", ".", "get", "(", "busName", ")", ";", "if", "(", "listeners", "!=", "null", ")", "{", "listeners", ".", "remove", "(", "listener", ")", ";", "if", "(", "listeners", ".", "isEmpty", "(", ")", ")", "{", "MESSAGING_ENGINE_LISTENERS", ".", "remove", "(", "busName", ")", ";", "}", "}", "}", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "TRACE", ",", "methodName", ")", ";", "}", "}" ]
Deregisters a listener for active messaging engines on a bus. @param listener the listener to deregister @param busName the name of the bus the listener was registered with
[ "Deregisters", "a", "listener", "for", "active", "messaging", "engines", "on", "a", "bus", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java#L167-L191
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java
SibRaEngineComponent.getMessagingEngines
public static JsMessagingEngine[] getMessagingEngines(final String busName) { final String methodName = "getMessagingEngines"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, busName); } final JsMessagingEngine[] result; synchronized (MESSAGING_ENGINES) { // Do we have any messaging engines for the given bus? final Set messagingEngines = (Set) MESSAGING_ENGINES.get(busName); if (messagingEngines == null) { // If not, return an empty array result = new JsMessagingEngine[0]; } else { // If we do, convert the set to an array result = (JsMessagingEngine[]) messagingEngines .toArray(new JsMessagingEngine[messagingEngines.size()]); } } if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName, result); } return result; }
java
public static JsMessagingEngine[] getMessagingEngines(final String busName) { final String methodName = "getMessagingEngines"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, busName); } final JsMessagingEngine[] result; synchronized (MESSAGING_ENGINES) { // Do we have any messaging engines for the given bus? final Set messagingEngines = (Set) MESSAGING_ENGINES.get(busName); if (messagingEngines == null) { // If not, return an empty array result = new JsMessagingEngine[0]; } else { // If we do, convert the set to an array result = (JsMessagingEngine[]) messagingEngines .toArray(new JsMessagingEngine[messagingEngines.size()]); } } if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName, result); } return result; }
[ "public", "static", "JsMessagingEngine", "[", "]", "getMessagingEngines", "(", "final", "String", "busName", ")", "{", "final", "String", "methodName", "=", "\"getMessagingEngines\"", ";", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "TRACE", ",", "methodName", ",", "busName", ")", ";", "}", "final", "JsMessagingEngine", "[", "]", "result", ";", "synchronized", "(", "MESSAGING_ENGINES", ")", "{", "// Do we have any messaging engines for the given bus?", "final", "Set", "messagingEngines", "=", "(", "Set", ")", "MESSAGING_ENGINES", ".", "get", "(", "busName", ")", ";", "if", "(", "messagingEngines", "==", "null", ")", "{", "// If not, return an empty array", "result", "=", "new", "JsMessagingEngine", "[", "0", "]", ";", "}", "else", "{", "// If we do, convert the set to an array", "result", "=", "(", "JsMessagingEngine", "[", "]", ")", "messagingEngines", ".", "toArray", "(", "new", "JsMessagingEngine", "[", "messagingEngines", ".", "size", "(", ")", "]", ")", ";", "}", "}", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "TRACE", ",", "methodName", ",", "result", ")", ";", "}", "return", "result", ";", "}" ]
Returns an array of initialized messaging engines for the given bus. If there are none, an empty array is returned. @param busName the bus name @return the set of <code>JsMessagingEngine</code> instances
[ "Returns", "an", "array", "of", "initialized", "messaging", "engines", "for", "the", "given", "bus", ".", "If", "there", "are", "none", "an", "empty", "array", "is", "returned", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java#L201-L235
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java
SibRaEngineComponent.engineReloaded
public void engineReloaded(Object objectSent) { final JsMessagingEngine engine = (JsMessagingEngine)objectSent; final String methodName = "engineReloaded"; if (TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, engine); } RELOADING_MESSAGING_ENGINES.remove(engine.getUuid().toString()); // Get listeners to notify final Set listeners = getListeners(engine.getBusName()); // Notify listeners for (final Iterator iterator = listeners.iterator(); iterator.hasNext();) { final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator .next(); listener.messagingEngineReloaded(engine); } if (TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, methodName); } }
java
public void engineReloaded(Object objectSent) { final JsMessagingEngine engine = (JsMessagingEngine)objectSent; final String methodName = "engineReloaded"; if (TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, engine); } RELOADING_MESSAGING_ENGINES.remove(engine.getUuid().toString()); // Get listeners to notify final Set listeners = getListeners(engine.getBusName()); // Notify listeners for (final Iterator iterator = listeners.iterator(); iterator.hasNext();) { final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator .next(); listener.messagingEngineReloaded(engine); } if (TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, methodName); } }
[ "public", "void", "engineReloaded", "(", "Object", "objectSent", ")", "{", "final", "JsMessagingEngine", "engine", "=", "(", "JsMessagingEngine", ")", "objectSent", ";", "final", "String", "methodName", "=", "\"engineReloaded\"", ";", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "TRACE", ",", "methodName", ",", "engine", ")", ";", "}", "RELOADING_MESSAGING_ENGINES", ".", "remove", "(", "engine", ".", "getUuid", "(", ")", ".", "toString", "(", ")", ")", ";", "// Get listeners to notify", "final", "Set", "listeners", "=", "getListeners", "(", "engine", ".", "getBusName", "(", ")", ")", ";", "// Notify listeners", "for", "(", "final", "Iterator", "iterator", "=", "listeners", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "final", "SibRaMessagingEngineListener", "listener", "=", "(", "SibRaMessagingEngineListener", ")", "iterator", ".", "next", "(", ")", ";", "listener", ".", "messagingEngineReloaded", "(", "engine", ")", ";", "}", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "this", ",", "TRACE", ",", "methodName", ")", ";", "}", "}" ]
lohith liberty change
[ "lohith", "liberty", "change" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java#L660-L687
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java
SibRaEngineComponent.getListeners
private static Set getListeners(final String busName) { final String methodName = "getListeners"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, busName); } final Set listeners = new HashSet(); synchronized (MESSAGING_ENGINE_LISTENERS) { // Get listeners for the particular bus final Set busListeners = (Set) MESSAGING_ENGINE_LISTENERS .get(busName); if (busListeners != null) { listeners.addAll(busListeners); } // Get listeners for all busses final Set noBusListeners = (Set) MESSAGING_ENGINE_LISTENERS .get(null); if (noBusListeners != null) { listeners.addAll(noBusListeners); } } if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName, listeners); } return listeners; }
java
private static Set getListeners(final String busName) { final String methodName = "getListeners"; if (TRACE.isEntryEnabled()) { SibTr.entry(TRACE, methodName, busName); } final Set listeners = new HashSet(); synchronized (MESSAGING_ENGINE_LISTENERS) { // Get listeners for the particular bus final Set busListeners = (Set) MESSAGING_ENGINE_LISTENERS .get(busName); if (busListeners != null) { listeners.addAll(busListeners); } // Get listeners for all busses final Set noBusListeners = (Set) MESSAGING_ENGINE_LISTENERS .get(null); if (noBusListeners != null) { listeners.addAll(noBusListeners); } } if (TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName, listeners); } return listeners; }
[ "private", "static", "Set", "getListeners", "(", "final", "String", "busName", ")", "{", "final", "String", "methodName", "=", "\"getListeners\"", ";", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "TRACE", ",", "methodName", ",", "busName", ")", ";", "}", "final", "Set", "listeners", "=", "new", "HashSet", "(", ")", ";", "synchronized", "(", "MESSAGING_ENGINE_LISTENERS", ")", "{", "// Get listeners for the particular bus", "final", "Set", "busListeners", "=", "(", "Set", ")", "MESSAGING_ENGINE_LISTENERS", ".", "get", "(", "busName", ")", ";", "if", "(", "busListeners", "!=", "null", ")", "{", "listeners", ".", "addAll", "(", "busListeners", ")", ";", "}", "// Get listeners for all busses", "final", "Set", "noBusListeners", "=", "(", "Set", ")", "MESSAGING_ENGINE_LISTENERS", ".", "get", "(", "null", ")", ";", "if", "(", "noBusListeners", "!=", "null", ")", "{", "listeners", ".", "addAll", "(", "noBusListeners", ")", ";", "}", "}", "if", "(", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "TRACE", ",", "methodName", ",", "listeners", ")", ";", "}", "return", "listeners", ";", "}" ]
Returns the set of listeners for the given bus. @param busName the name of the bus @return the listeners for that bus or the empty set if there are none.
[ "Returns", "the", "set", "of", "listeners", "for", "the", "given", "bus", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/SibRaEngineComponent.java#L696-L728
train
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/ExecutionElementControllerFactory.java
ExecutionElementControllerFactory.isTruePartitionOfTopLevelStep
private static boolean isTruePartitionOfTopLevelStep(Step step) { Partition partition = step.getPartition(); if (partition.getMapper() != null ) { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found partitioned step with mapper" , step); } return true; } else if (partition.getPlan() != null) { if (partition.getPlan().getPartitions() != null) { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found partitioned step with plan", step); } return true; } else { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found plan with partitions stripped out. Must be a partition on the partition work unit thread", step); } return false; } } else { throw new IllegalArgumentException("Partition does not contain either a mapper or a plan. Aborting."); } }
java
private static boolean isTruePartitionOfTopLevelStep(Step step) { Partition partition = step.getPartition(); if (partition.getMapper() != null ) { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found partitioned step with mapper" , step); } return true; } else if (partition.getPlan() != null) { if (partition.getPlan().getPartitions() != null) { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found partitioned step with plan", step); } return true; } else { if (logger.isLoggable(Level.FINER)) { logger.logp(Level.FINER, CLASSNAME, "validatePartition", "Found plan with partitions stripped out. Must be a partition on the partition work unit thread", step); } return false; } } else { throw new IllegalArgumentException("Partition does not contain either a mapper or a plan. Aborting."); } }
[ "private", "static", "boolean", "isTruePartitionOfTopLevelStep", "(", "Step", "step", ")", "{", "Partition", "partition", "=", "step", ".", "getPartition", "(", ")", ";", "if", "(", "partition", ".", "getMapper", "(", ")", "!=", "null", ")", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "{", "logger", ".", "logp", "(", "Level", ".", "FINER", ",", "CLASSNAME", ",", "\"validatePartition\"", ",", "\"Found partitioned step with mapper\"", ",", "step", ")", ";", "}", "return", "true", ";", "}", "else", "if", "(", "partition", ".", "getPlan", "(", ")", "!=", "null", ")", "{", "if", "(", "partition", ".", "getPlan", "(", ")", ".", "getPartitions", "(", ")", "!=", "null", ")", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "{", "logger", ".", "logp", "(", "Level", ".", "FINER", ",", "CLASSNAME", ",", "\"validatePartition\"", ",", "\"Found partitioned step with plan\"", ",", "step", ")", ";", "}", "return", "true", ";", "}", "else", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "{", "logger", ".", "logp", "(", "Level", ".", "FINER", ",", "CLASSNAME", ",", "\"validatePartition\"", ",", "\"Found plan with partitions stripped out. Must be a partition on the partition work unit thread\"", ",", "step", ")", ";", "}", "return", "false", ";", "}", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "\"Partition does not contain either a mapper or a plan. Aborting.\"", ")", ";", "}", "}" ]
Need to perform this check because of the way we manipulate the model in building our "subjob" for the partition.
[ "Need", "to", "perform", "this", "check", "because", "of", "the", "way", "we", "manipulate", "the", "model", "in", "building", "our", "subjob", "for", "the", "partition", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/ExecutionElementControllerFactory.java#L92-L116
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java
StaticTraceInstrumentation.processClassConfiguration
protected ClassConfigData processClassConfiguration(final InputStream inputStream) throws IOException { if (introspectAnnotations == false) { return new ClassConfigData(inputStream); } ClassReader cr = new ClassReader(inputStream); ClassWriter cw = new ClassWriter(cr, 0); // Don't compute anything - read only mode TraceConfigClassVisitor cv = new TraceConfigClassVisitor(cw); cr.accept(cv, 0); ClassInfo classInfo = cv.getClassInfo(); InputStream classInputStream = new ByteArrayInputStream(cw.toByteArray()); return new ClassConfigData(classInputStream, classInfo); }
java
protected ClassConfigData processClassConfiguration(final InputStream inputStream) throws IOException { if (introspectAnnotations == false) { return new ClassConfigData(inputStream); } ClassReader cr = new ClassReader(inputStream); ClassWriter cw = new ClassWriter(cr, 0); // Don't compute anything - read only mode TraceConfigClassVisitor cv = new TraceConfigClassVisitor(cw); cr.accept(cv, 0); ClassInfo classInfo = cv.getClassInfo(); InputStream classInputStream = new ByteArrayInputStream(cw.toByteArray()); return new ClassConfigData(classInputStream, classInfo); }
[ "protected", "ClassConfigData", "processClassConfiguration", "(", "final", "InputStream", "inputStream", ")", "throws", "IOException", "{", "if", "(", "introspectAnnotations", "==", "false", ")", "{", "return", "new", "ClassConfigData", "(", "inputStream", ")", ";", "}", "ClassReader", "cr", "=", "new", "ClassReader", "(", "inputStream", ")", ";", "ClassWriter", "cw", "=", "new", "ClassWriter", "(", "cr", ",", "0", ")", ";", "// Don't compute anything - read only mode", "TraceConfigClassVisitor", "cv", "=", "new", "TraceConfigClassVisitor", "(", "cw", ")", ";", "cr", ".", "accept", "(", "cv", ",", "0", ")", ";", "ClassInfo", "classInfo", "=", "cv", ".", "getClassInfo", "(", ")", ";", "InputStream", "classInputStream", "=", "new", "ByteArrayInputStream", "(", "cw", ".", "toByteArray", "(", ")", ")", ";", "return", "new", "ClassConfigData", "(", "classInputStream", ",", "classInfo", ")", ";", "}" ]
Introspect configuration information from the class in the provided InputStream.
[ "Introspect", "configuration", "information", "from", "the", "class", "in", "the", "provided", "InputStream", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java#L206-L219
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java
StaticTraceInstrumentation.mergeClassConfigInfo
protected ClassInfo mergeClassConfigInfo(ClassInfo classInfo) { // Update introspected class information from introspected package PackageInfo packageInfo = configFileParser.getPackageInfo(classInfo.getInternalPackageName()); if (packageInfo == null) { packageInfo = getPackageInfo(classInfo.getInternalPackageName()); } classInfo.updateDefaultValuesFromPackageInfo(packageInfo); // Override introspected class information from configuration document ClassInfo ci = configFileParser.getClassInfo(classInfo.getInternalClassName()); if (ci != null) { classInfo.overrideValuesFromExplicitClassInfo(ci); } return classInfo; }
java
protected ClassInfo mergeClassConfigInfo(ClassInfo classInfo) { // Update introspected class information from introspected package PackageInfo packageInfo = configFileParser.getPackageInfo(classInfo.getInternalPackageName()); if (packageInfo == null) { packageInfo = getPackageInfo(classInfo.getInternalPackageName()); } classInfo.updateDefaultValuesFromPackageInfo(packageInfo); // Override introspected class information from configuration document ClassInfo ci = configFileParser.getClassInfo(classInfo.getInternalClassName()); if (ci != null) { classInfo.overrideValuesFromExplicitClassInfo(ci); } return classInfo; }
[ "protected", "ClassInfo", "mergeClassConfigInfo", "(", "ClassInfo", "classInfo", ")", "{", "// Update introspected class information from introspected package", "PackageInfo", "packageInfo", "=", "configFileParser", ".", "getPackageInfo", "(", "classInfo", ".", "getInternalPackageName", "(", ")", ")", ";", "if", "(", "packageInfo", "==", "null", ")", "{", "packageInfo", "=", "getPackageInfo", "(", "classInfo", ".", "getInternalPackageName", "(", ")", ")", ";", "}", "classInfo", ".", "updateDefaultValuesFromPackageInfo", "(", "packageInfo", ")", ";", "// Override introspected class information from configuration document", "ClassInfo", "ci", "=", "configFileParser", ".", "getClassInfo", "(", "classInfo", ".", "getInternalClassName", "(", ")", ")", ";", "if", "(", "ci", "!=", "null", ")", "{", "classInfo", ".", "overrideValuesFromExplicitClassInfo", "(", "ci", ")", ";", "}", "return", "classInfo", ";", "}" ]
Attempt to normalize the various levels of configuration information prior to instrumenting a class.
[ "Attempt", "to", "normalize", "the", "various", "levels", "of", "configuration", "information", "prior", "to", "instrumenting", "a", "class", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java#L237-L252
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java
StaticTraceInstrumentation.printUsageMessage
private static void printUsageMessage() { System.out.println("Description:"); System.out.println(" StaticTraceInstrumentation can modify classes"); System.out.println(" in place to add calls to a trace framework that will"); System.out.println(" delegate to JSR47 logging or WebSphere Tr."); System.out.println(""); System.out.println("Required arguments:"); System.out.println(" The paths to one or more binary classes, jars, or"); System.out.println(" directories to scan for classes and jars are required"); System.out.println(" parameters."); System.out.println(""); System.out.println(" Class files must have a .class extension."); System.out.println(" Jar files must have a .jar or a .zip extension."); System.out.println(" Directories are recursively scanned for .jar, .zip, and"); System.out.println(" .class files to instrument."); }
java
private static void printUsageMessage() { System.out.println("Description:"); System.out.println(" StaticTraceInstrumentation can modify classes"); System.out.println(" in place to add calls to a trace framework that will"); System.out.println(" delegate to JSR47 logging or WebSphere Tr."); System.out.println(""); System.out.println("Required arguments:"); System.out.println(" The paths to one or more binary classes, jars, or"); System.out.println(" directories to scan for classes and jars are required"); System.out.println(" parameters."); System.out.println(""); System.out.println(" Class files must have a .class extension."); System.out.println(" Jar files must have a .jar or a .zip extension."); System.out.println(" Directories are recursively scanned for .jar, .zip, and"); System.out.println(" .class files to instrument."); }
[ "private", "static", "void", "printUsageMessage", "(", ")", "{", "System", ".", "out", ".", "println", "(", "\"Description:\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" StaticTraceInstrumentation can modify classes\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" in place to add calls to a trace framework that will\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" delegate to JSR47 logging or WebSphere Tr.\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Required arguments:\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" The paths to one or more binary classes, jars, or\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" directories to scan for classes and jars are required\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" parameters.\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" Class files must have a .class extension.\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" Jar files must have a .jar or a .zip extension.\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" Directories are recursively scanned for .jar, .zip, and\"", ")", ";", "System", ".", "out", ".", "println", "(", "\" .class files to instrument.\"", ")", ";", "}" ]
Gentle usage message that needs to be written.
[ "Gentle", "usage", "message", "that", "needs", "to", "be", "written", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/StaticTraceInstrumentation.java#L326-L341
train
OpenLiberty/open-liberty
dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/LibertyVersionRange.java
LibertyVersionRange.valueOf
public static LibertyVersionRange valueOf(String versionRangeString) { if (versionRangeString == null) { return null; } Matcher versionRangeMatcher = VERSION_RANGE_PATTERN.matcher(versionRangeString); if (versionRangeMatcher.matches()) { // Have a min and max so parse both LibertyVersion minVersion = LibertyVersion.valueOf(versionRangeMatcher.group(1)); LibertyVersion maxVersion = LibertyVersion.valueOf(versionRangeMatcher.group(2)); // Make sure both were valid versions if (minVersion != null && maxVersion != null) { return new LibertyVersionRange(minVersion, maxVersion); } else { return null; } } else { // It's not a range so see if it's a single version LibertyVersion minVersion = LibertyVersion.valueOf(versionRangeString); if (minVersion != null) { return new LibertyVersionRange(minVersion, null); } else { return null; } } }
java
public static LibertyVersionRange valueOf(String versionRangeString) { if (versionRangeString == null) { return null; } Matcher versionRangeMatcher = VERSION_RANGE_PATTERN.matcher(versionRangeString); if (versionRangeMatcher.matches()) { // Have a min and max so parse both LibertyVersion minVersion = LibertyVersion.valueOf(versionRangeMatcher.group(1)); LibertyVersion maxVersion = LibertyVersion.valueOf(versionRangeMatcher.group(2)); // Make sure both were valid versions if (minVersion != null && maxVersion != null) { return new LibertyVersionRange(minVersion, maxVersion); } else { return null; } } else { // It's not a range so see if it's a single version LibertyVersion minVersion = LibertyVersion.valueOf(versionRangeString); if (minVersion != null) { return new LibertyVersionRange(minVersion, null); } else { return null; } } }
[ "public", "static", "LibertyVersionRange", "valueOf", "(", "String", "versionRangeString", ")", "{", "if", "(", "versionRangeString", "==", "null", ")", "{", "return", "null", ";", "}", "Matcher", "versionRangeMatcher", "=", "VERSION_RANGE_PATTERN", ".", "matcher", "(", "versionRangeString", ")", ";", "if", "(", "versionRangeMatcher", ".", "matches", "(", ")", ")", "{", "// Have a min and max so parse both", "LibertyVersion", "minVersion", "=", "LibertyVersion", ".", "valueOf", "(", "versionRangeMatcher", ".", "group", "(", "1", ")", ")", ";", "LibertyVersion", "maxVersion", "=", "LibertyVersion", ".", "valueOf", "(", "versionRangeMatcher", ".", "group", "(", "2", ")", ")", ";", "// Make sure both were valid versions", "if", "(", "minVersion", "!=", "null", "&&", "maxVersion", "!=", "null", ")", "{", "return", "new", "LibertyVersionRange", "(", "minVersion", ",", "maxVersion", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "else", "{", "// It's not a range so see if it's a single version", "LibertyVersion", "minVersion", "=", "LibertyVersion", ".", "valueOf", "(", "versionRangeString", ")", ";", "if", "(", "minVersion", "!=", "null", ")", "{", "return", "new", "LibertyVersionRange", "(", "minVersion", ",", "null", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "}" ]
Attempts to parse the supplied version range string into a Liberty version range containing just numbers. If it fails to do so it will return null. @param versionRangeString The String to parse @return The {@link LibertyVersionRange} or <code>null</code> if the string is in the wrong form.
[ "Attempts", "to", "parse", "the", "supplied", "version", "range", "string", "into", "a", "Liberty", "version", "range", "containing", "just", "numbers", ".", "If", "it", "fails", "to", "do", "so", "it", "will", "return", "null", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/LibertyVersionRange.java#L44-L69
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/LocalQPConsumerKeyFilter.java
LocalQPConsumerKeyFilter.detach
protected void detach() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "detach"); // Cleanly dispose of the getCursor getCursor.finished(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "detach"); }
java
protected void detach() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "detach"); // Cleanly dispose of the getCursor getCursor.finished(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "detach"); }
[ "protected", "void", "detach", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"detach\"", ")", ";", "// Cleanly dispose of the getCursor", "getCursor", ".", "finished", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"detach\"", ")", ";", "}" ]
Detach processing for this filter
[ "Detach", "processing", "for", "this", "filter" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/LocalQPConsumerKeyFilter.java#L129-L139
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/LocalQPConsumerKeyFilter.java
LocalQPConsumerKeyFilter.discard
protected void discard() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "discard"); // Discard any old cursor if(getCursor != null) { getCursor.finished(); getCursor = null; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "discard"); }
java
protected void discard() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "discard"); // Discard any old cursor if(getCursor != null) { getCursor.finished(); getCursor = null; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "discard"); }
[ "protected", "void", "discard", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"discard\"", ")", ";", "// Discard any old cursor", "if", "(", "getCursor", "!=", "null", ")", "{", "getCursor", ".", "finished", "(", ")", ";", "getCursor", "=", "null", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"discard\"", ")", ";", "}" ]
Discard processing for this filter
[ "Discard", "processing", "for", "this", "filter" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/LocalQPConsumerKeyFilter.java#L144-L158
train
OpenLiberty/open-liberty
dev/com.ibm.ws.cdi.ejb.common/src/com/ibm/ws/cdi/ejb/impl/WebSphereEjbServicesImpl.java
WebSphereEjbServicesImpl.registerInterceptors
@Override public void registerInterceptors(EjbDescriptor<?> ejbDescriptor, InterceptorBindings interceptorBindings) { if (interceptorBindings != null) { final Collection<Interceptor<?>> interceptors = interceptorBindings.getAllInterceptors(); if (interceptors != null) { for (Interceptor<?> interceptor : interceptors) { final Set<Annotation> annotations = interceptor.getInterceptorBindings(); if (annotations != null) { for (Annotation annotation : annotations) { if (Transactional.class.equals(annotation.annotationType())) { // An NPE if ejbDescriptor is null will work just fine too throw new IllegalStateException(Tr.formatMessage(tc, "transactional.annotation.on.ejb.CWOWB2000E", annotation.toString(), ejbDescriptor.getEjbName())); } } } } EjbDescriptor<?> descriptor = ejbDescriptor; WebSphereEjbDescriptor<?> webSphereEjbDescriptor = findWebSphereEjbDescriptor(descriptor); J2EEName ejbJ2EEName = webSphereEjbDescriptor.getEjbJ2EEName(); interceptorRegistry.registerInterceptors(ejbJ2EEName, interceptorBindings); } } }
java
@Override public void registerInterceptors(EjbDescriptor<?> ejbDescriptor, InterceptorBindings interceptorBindings) { if (interceptorBindings != null) { final Collection<Interceptor<?>> interceptors = interceptorBindings.getAllInterceptors(); if (interceptors != null) { for (Interceptor<?> interceptor : interceptors) { final Set<Annotation> annotations = interceptor.getInterceptorBindings(); if (annotations != null) { for (Annotation annotation : annotations) { if (Transactional.class.equals(annotation.annotationType())) { // An NPE if ejbDescriptor is null will work just fine too throw new IllegalStateException(Tr.formatMessage(tc, "transactional.annotation.on.ejb.CWOWB2000E", annotation.toString(), ejbDescriptor.getEjbName())); } } } } EjbDescriptor<?> descriptor = ejbDescriptor; WebSphereEjbDescriptor<?> webSphereEjbDescriptor = findWebSphereEjbDescriptor(descriptor); J2EEName ejbJ2EEName = webSphereEjbDescriptor.getEjbJ2EEName(); interceptorRegistry.registerInterceptors(ejbJ2EEName, interceptorBindings); } } }
[ "@", "Override", "public", "void", "registerInterceptors", "(", "EjbDescriptor", "<", "?", ">", "ejbDescriptor", ",", "InterceptorBindings", "interceptorBindings", ")", "{", "if", "(", "interceptorBindings", "!=", "null", ")", "{", "final", "Collection", "<", "Interceptor", "<", "?", ">", ">", "interceptors", "=", "interceptorBindings", ".", "getAllInterceptors", "(", ")", ";", "if", "(", "interceptors", "!=", "null", ")", "{", "for", "(", "Interceptor", "<", "?", ">", "interceptor", ":", "interceptors", ")", "{", "final", "Set", "<", "Annotation", ">", "annotations", "=", "interceptor", ".", "getInterceptorBindings", "(", ")", ";", "if", "(", "annotations", "!=", "null", ")", "{", "for", "(", "Annotation", "annotation", ":", "annotations", ")", "{", "if", "(", "Transactional", ".", "class", ".", "equals", "(", "annotation", ".", "annotationType", "(", ")", ")", ")", "{", "// An NPE if ejbDescriptor is null will work just fine too", "throw", "new", "IllegalStateException", "(", "Tr", ".", "formatMessage", "(", "tc", ",", "\"transactional.annotation.on.ejb.CWOWB2000E\"", ",", "annotation", ".", "toString", "(", ")", ",", "ejbDescriptor", ".", "getEjbName", "(", ")", ")", ")", ";", "}", "}", "}", "}", "EjbDescriptor", "<", "?", ">", "descriptor", "=", "ejbDescriptor", ";", "WebSphereEjbDescriptor", "<", "?", ">", "webSphereEjbDescriptor", "=", "findWebSphereEjbDescriptor", "(", "descriptor", ")", ";", "J2EEName", "ejbJ2EEName", "=", "webSphereEjbDescriptor", ".", "getEjbJ2EEName", "(", ")", ";", "interceptorRegistry", ".", "registerInterceptors", "(", "ejbJ2EEName", ",", "interceptorBindings", ")", ";", "}", "}", "}" ]
Throw an exception if an interceptor for Transactional is registered
[ "Throw", "an", "exception", "if", "an", "interceptor", "for", "Transactional", "is", "registered" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.ejb.common/src/com/ibm/ws/cdi/ejb/impl/WebSphereEjbServicesImpl.java#L57-L84
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/wsspi/security/common/auth/module/IdentityAssertionLoginModule.java
IdentityAssertionLoginModule.updateSubjectWithTemporarySubjectContents
protected void updateSubjectWithTemporarySubjectContents() { subject.getPrincipals().addAll(temporarySubject.getPrincipals()); subject.getPublicCredentials().addAll(temporarySubject.getPublicCredentials()); subject.getPrivateCredentials().addAll(temporarySubject.getPrivateCredentials()); }
java
protected void updateSubjectWithTemporarySubjectContents() { subject.getPrincipals().addAll(temporarySubject.getPrincipals()); subject.getPublicCredentials().addAll(temporarySubject.getPublicCredentials()); subject.getPrivateCredentials().addAll(temporarySubject.getPrivateCredentials()); }
[ "protected", "void", "updateSubjectWithTemporarySubjectContents", "(", ")", "{", "subject", ".", "getPrincipals", "(", ")", ".", "addAll", "(", "temporarySubject", ".", "getPrincipals", "(", ")", ")", ";", "subject", ".", "getPublicCredentials", "(", ")", ".", "addAll", "(", "temporarySubject", ".", "getPublicCredentials", "(", ")", ")", ";", "subject", ".", "getPrivateCredentials", "(", ")", ".", "addAll", "(", "temporarySubject", ".", "getPrivateCredentials", "(", ")", ")", ";", "}" ]
Sets the subject with the temporary subject contents that was not set already from the shared state.
[ "Sets", "the", "subject", "with", "the", "temporary", "subject", "contents", "that", "was", "not", "set", "already", "from", "the", "shared", "state", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/wsspi/security/common/auth/module/IdentityAssertionLoginModule.java#L261-L265
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DistributedObjectCacheAdapter.java
DistributedObjectCacheAdapter.size
@Override public int size(boolean includeDiskCache) { int mappings = 0; mappings = cache.getNumberCacheEntries(); if (includeDiskCache) { if (cache instanceof CacheProviderWrapper) { CacheProviderWrapper cpw = (CacheProviderWrapper) cache; if (cpw.featureSupport.isDiskCacheSupported()) mappings = mappings + cache.getIdsSizeDisk(); } else { mappings = mappings + cache.getIdsSizeDisk(); } } return mappings; }
java
@Override public int size(boolean includeDiskCache) { int mappings = 0; mappings = cache.getNumberCacheEntries(); if (includeDiskCache) { if (cache instanceof CacheProviderWrapper) { CacheProviderWrapper cpw = (CacheProviderWrapper) cache; if (cpw.featureSupport.isDiskCacheSupported()) mappings = mappings + cache.getIdsSizeDisk(); } else { mappings = mappings + cache.getIdsSizeDisk(); } } return mappings; }
[ "@", "Override", "public", "int", "size", "(", "boolean", "includeDiskCache", ")", "{", "int", "mappings", "=", "0", ";", "mappings", "=", "cache", ".", "getNumberCacheEntries", "(", ")", ";", "if", "(", "includeDiskCache", ")", "{", "if", "(", "cache", "instanceof", "CacheProviderWrapper", ")", "{", "CacheProviderWrapper", "cpw", "=", "(", "CacheProviderWrapper", ")", "cache", ";", "if", "(", "cpw", ".", "featureSupport", ".", "isDiskCacheSupported", "(", ")", ")", "mappings", "=", "mappings", "+", "cache", ".", "getIdsSizeDisk", "(", ")", ";", "}", "else", "{", "mappings", "=", "mappings", "+", "cache", ".", "getIdsSizeDisk", "(", ")", ";", "}", "}", "return", "mappings", ";", "}" ]
Returns number of key-value mappings in this map. @param includeDiskCache true to get the size of the memory and disk maps; false to get the size of memory map. @return the number of key-value mappings in this map.
[ "Returns", "number", "of", "key", "-", "value", "mappings", "in", "this", "map", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DistributedObjectCacheAdapter.java#L286-L302
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DistributedObjectCacheAdapter.java
DistributedObjectCacheAdapter.addAlias
@Override public void addAlias(Object key, Object[] aliasArray) { final String methodName = "addAlias(key, aliasArray)"; functionNotAvailable(methodName); }
java
@Override public void addAlias(Object key, Object[] aliasArray) { final String methodName = "addAlias(key, aliasArray)"; functionNotAvailable(methodName); }
[ "@", "Override", "public", "void", "addAlias", "(", "Object", "key", ",", "Object", "[", "]", "aliasArray", ")", "{", "final", "String", "methodName", "=", "\"addAlias(key, aliasArray)\"", ";", "functionNotAvailable", "(", "methodName", ")", ";", "}" ]
Adds one or more aliases for the given key in the cache's mapping table. If the alias is already associated with another key, it will be changed to associate with the new key. @param key the key assoicated with alias @param aliasArray the aliases to use for lookups @throws IllegalArgumentException if the key is not in the cache's mapping table.
[ "Adds", "one", "or", "more", "aliases", "for", "the", "given", "key", "in", "the", "cache", "s", "mapping", "table", ".", "If", "the", "alias", "is", "already", "associated", "with", "another", "key", "it", "will", "be", "changed", "to", "associate", "with", "the", "new", "key", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DistributedObjectCacheAdapter.java#L964-L968
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DistributedObjectCacheAdapter.java
DistributedObjectCacheAdapter.invalidate
@Override public void invalidate(Object key, boolean wait, boolean checkPreInvalidationListener) { final String methodName = "invalidate(key, wait, checkPreInvalidationListener)"; functionNotAvailable(methodName); }
java
@Override public void invalidate(Object key, boolean wait, boolean checkPreInvalidationListener) { final String methodName = "invalidate(key, wait, checkPreInvalidationListener)"; functionNotAvailable(methodName); }
[ "@", "Override", "public", "void", "invalidate", "(", "Object", "key", ",", "boolean", "wait", ",", "boolean", "checkPreInvalidationListener", ")", "{", "final", "String", "methodName", "=", "\"invalidate(key, wait, checkPreInvalidationListener)\"", ";", "functionNotAvailable", "(", "methodName", ")", ";", "}" ]
invalidate - invalidates the given key. If the key is for a specific cache entry, then only that object is invalidated. If the key is for a dependency id, then all objects that share that dependency id will be invalidated. @param key the key which will be invalidated @param wait if true, then the method will not complete until the invalidation has occured. if false, then the invalidation will occur in batch mode @see remove
[ "invalidate", "-", "invalidates", "the", "given", "key", ".", "If", "the", "key", "is", "for", "a", "specific", "cache", "entry", "then", "only", "that", "object", "is", "invalidated", ".", "If", "the", "key", "is", "for", "a", "dependency", "id", "then", "all", "objects", "that", "share", "that", "dependency", "id", "will", "be", "invalidated", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DistributedObjectCacheAdapter.java#L1223-L1227
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsMessageRouterImpl.java
WsMessageRouterImpl.setWsLogHandler
public void setWsLogHandler(String id, WsLogHandler ref) { if (id != null && ref != null) { //There can be many Reader locks, but only one writer lock. //This ReaderWriter lock is needed to avoid duplicate messages when the class is passing on EarlyBuffer messages to the new WsLogHandler. RERWLOCK.writeLock().lock(); try { wsLogHandlerServices.put(id, ref); /* * Route prev messages to the new LogHandler. * * This is primarily for solving the problem during server init where the WsMessageRouterImpl * is registered *after* we've already issued some early startup messages. We cache * these early messages in the "earlierMessages" queue in BaseTraceService, which then * passes them to WsMessageRouterImpl once it's registered. */ if (earlierMessages == null) { return; } for (RoutedMessage earlierMessage : earlierMessages.toArray(new RoutedMessage[earlierMessages.size()])) { if (shouldRouteMessageToLogHandler(earlierMessage, id)) { routeTo(earlierMessage, id); } } } finally { RERWLOCK.writeLock().unlock(); } } }
java
public void setWsLogHandler(String id, WsLogHandler ref) { if (id != null && ref != null) { //There can be many Reader locks, but only one writer lock. //This ReaderWriter lock is needed to avoid duplicate messages when the class is passing on EarlyBuffer messages to the new WsLogHandler. RERWLOCK.writeLock().lock(); try { wsLogHandlerServices.put(id, ref); /* * Route prev messages to the new LogHandler. * * This is primarily for solving the problem during server init where the WsMessageRouterImpl * is registered *after* we've already issued some early startup messages. We cache * these early messages in the "earlierMessages" queue in BaseTraceService, which then * passes them to WsMessageRouterImpl once it's registered. */ if (earlierMessages == null) { return; } for (RoutedMessage earlierMessage : earlierMessages.toArray(new RoutedMessage[earlierMessages.size()])) { if (shouldRouteMessageToLogHandler(earlierMessage, id)) { routeTo(earlierMessage, id); } } } finally { RERWLOCK.writeLock().unlock(); } } }
[ "public", "void", "setWsLogHandler", "(", "String", "id", ",", "WsLogHandler", "ref", ")", "{", "if", "(", "id", "!=", "null", "&&", "ref", "!=", "null", ")", "{", "//There can be many Reader locks, but only one writer lock.", "//This ReaderWriter lock is needed to avoid duplicate messages when the class is passing on EarlyBuffer messages to the new WsLogHandler.", "RERWLOCK", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "wsLogHandlerServices", ".", "put", "(", "id", ",", "ref", ")", ";", "/*\n * Route prev messages to the new LogHandler.\n *\n * This is primarily for solving the problem during server init where the WsMessageRouterImpl\n * is registered *after* we've already issued some early startup messages. We cache\n * these early messages in the \"earlierMessages\" queue in BaseTraceService, which then\n * passes them to WsMessageRouterImpl once it's registered.\n */", "if", "(", "earlierMessages", "==", "null", ")", "{", "return", ";", "}", "for", "(", "RoutedMessage", "earlierMessage", ":", "earlierMessages", ".", "toArray", "(", "new", "RoutedMessage", "[", "earlierMessages", ".", "size", "(", ")", "]", ")", ")", "{", "if", "(", "shouldRouteMessageToLogHandler", "(", "earlierMessage", ",", "id", ")", ")", "{", "routeTo", "(", "earlierMessage", ",", "id", ")", ";", "}", "}", "}", "finally", "{", "RERWLOCK", ".", "writeLock", "(", ")", ".", "unlock", "(", ")", ";", "}", "}", "}" ]
Add the WsLogHandler ref. 1 or more LogHandlers may be set.
[ "Add", "the", "WsLogHandler", "ref", ".", "1", "or", "more", "LogHandlers", "may", "be", "set", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsMessageRouterImpl.java#L94-L123
train
OpenLiberty/open-liberty
dev/com.ibm.ws.container.service.compat/src/com/ibm/jtc/adapter/DefaultPlatformAdapter.java
DefaultPlatformAdapter.getByteBufferAddress
public long getByteBufferAddress(ByteBuffer byteBuffer) { /* * This only works for DIRECT byte buffers. Direct ByteBuffers have a field * called "address" which * holds the physical address of the start of the buffer contents in native * memory. * This method obtains the value of the address field through reflection. */ if (!byteBuffer.isDirect()) { throw new IllegalArgumentException("The specified byte buffer is not direct"); } try { return svAddrField.getLong(byteBuffer); } catch (IllegalAccessException exception) { throw new RuntimeException(exception.getMessage()); } }
java
public long getByteBufferAddress(ByteBuffer byteBuffer) { /* * This only works for DIRECT byte buffers. Direct ByteBuffers have a field * called "address" which * holds the physical address of the start of the buffer contents in native * memory. * This method obtains the value of the address field through reflection. */ if (!byteBuffer.isDirect()) { throw new IllegalArgumentException("The specified byte buffer is not direct"); } try { return svAddrField.getLong(byteBuffer); } catch (IllegalAccessException exception) { throw new RuntimeException(exception.getMessage()); } }
[ "public", "long", "getByteBufferAddress", "(", "ByteBuffer", "byteBuffer", ")", "{", "/*\n * This only works for DIRECT byte buffers. Direct ByteBuffers have a field\n * called \"address\" which\n * holds the physical address of the start of the buffer contents in native\n * memory.\n * This method obtains the value of the address field through reflection.\n */", "if", "(", "!", "byteBuffer", ".", "isDirect", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The specified byte buffer is not direct\"", ")", ";", "}", "try", "{", "return", "svAddrField", ".", "getLong", "(", "byteBuffer", ")", ";", "}", "catch", "(", "IllegalAccessException", "exception", ")", "{", "throw", "new", "RuntimeException", "(", "exception", ".", "getMessage", "(", ")", ")", ";", "}", "}" ]
Get the native address for the specified DirectByteBuffer @param byteBuffer Reference to a DirectByteBuffer @return The native address of the specified DirectByteBuffer @throws IllegalArgumentException If the specified buffer is not direct
[ "Get", "the", "native", "address", "for", "the", "specified", "DirectByteBuffer" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/jtc/adapter/DefaultPlatformAdapter.java#L106-L122
train
OpenLiberty/open-liberty
dev/com.ibm.ws.container.service.compat/src/com/ibm/jtc/adapter/DefaultPlatformAdapter.java
DefaultPlatformAdapter.getSocketChannelHandle
public long getSocketChannelHandle(SocketChannel socketChannel) { StartPrivilegedThread privThread = new StartPrivilegedThread(socketChannel); return AccessController.doPrivileged(privThread); }
java
public long getSocketChannelHandle(SocketChannel socketChannel) { StartPrivilegedThread privThread = new StartPrivilegedThread(socketChannel); return AccessController.doPrivileged(privThread); }
[ "public", "long", "getSocketChannelHandle", "(", "SocketChannel", "socketChannel", ")", "{", "StartPrivilegedThread", "privThread", "=", "new", "StartPrivilegedThread", "(", "socketChannel", ")", ";", "return", "AccessController", ".", "doPrivileged", "(", "privThread", ")", ";", "}" ]
Get the socket channel handle. @param socketChannel The socket channel to get the handle from. @return The handle for the specified socket channel
[ "Get", "the", "socket", "channel", "handle", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/jtc/adapter/DefaultPlatformAdapter.java#L132-L135
train
OpenLiberty/open-liberty
dev/com.ibm.ws.container.service.compat/src/com/ibm/jtc/adapter/DefaultPlatformAdapter.java
DefaultPlatformAdapter.cleanThreadLocals
public void cleanThreadLocals(Thread thread) { try { svThreadLocalsField.set(thread, null); } catch (IllegalAccessException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Unable to clear java.lang.ThreadLocals: ", e); } }
java
public void cleanThreadLocals(Thread thread) { try { svThreadLocalsField.set(thread, null); } catch (IllegalAccessException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Unable to clear java.lang.ThreadLocals: ", e); } }
[ "public", "void", "cleanThreadLocals", "(", "Thread", "thread", ")", "{", "try", "{", "svThreadLocalsField", ".", "set", "(", "thread", ",", "null", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Unable to clear java.lang.ThreadLocals: \"", ",", "e", ")", ";", "}", "}" ]
Clean up the thread locals for the specified Thread. @param thread The thread to clean up
[ "Clean", "up", "the", "thread", "locals", "for", "the", "specified", "Thread", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/jtc/adapter/DefaultPlatformAdapter.java#L143-L150
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/mbeans/PluginGenerator.java
PluginGenerator.hasConfigChanged
private boolean hasConfigChanged(Document newConfig) { NodeList list = newConfig.getElementsByTagName("*"); int currentHash = nodeListHashValue(list); // Either this is the first time checking the config or there has been some change if (this.previousConfigHash == null || currentHash != this.previousConfigHash) { this.previousConfigHash = currentHash; return true; } // No config changes else { return false; } }
java
private boolean hasConfigChanged(Document newConfig) { NodeList list = newConfig.getElementsByTagName("*"); int currentHash = nodeListHashValue(list); // Either this is the first time checking the config or there has been some change if (this.previousConfigHash == null || currentHash != this.previousConfigHash) { this.previousConfigHash = currentHash; return true; } // No config changes else { return false; } }
[ "private", "boolean", "hasConfigChanged", "(", "Document", "newConfig", ")", "{", "NodeList", "list", "=", "newConfig", ".", "getElementsByTagName", "(", "\"*\"", ")", ";", "int", "currentHash", "=", "nodeListHashValue", "(", "list", ")", ";", "// Either this is the first time checking the config or there has been some change", "if", "(", "this", ".", "previousConfigHash", "==", "null", "||", "currentHash", "!=", "this", ".", "previousConfigHash", ")", "{", "this", ".", "previousConfigHash", "=", "currentHash", ";", "return", "true", ";", "}", "// No config changes", "else", "{", "return", "false", ";", "}", "}" ]
Check to see if the current config has the same information as the previously written config. If this config has no new information, return false. @param newConfig the current config information document to be compared @return true if there is new or updated config information
[ "Check", "to", "see", "if", "the", "current", "config", "has", "the", "same", "information", "as", "the", "previously", "written", "config", ".", "If", "this", "config", "has", "no", "new", "information", "return", "false", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/mbeans/PluginGenerator.java#L894-L907
train
OpenLiberty/open-liberty
dev/com.ibm.ws.artifact.url/src/com/ibm/ws/artifact/url/internal/WSJarURLStreamHandler.java
WSJarURLStreamHandler.openConnection
@Override public URLConnection openConnection(URL url) throws IOException { String path = url.getPath(); int resourceDelimiterIndex = path.indexOf("!/"); URLConnection conn; if (resourceDelimiterIndex == -1) { // The "jar" protocol requires that the path contain an entry path. // For backwards compatibility, we do not. Instead, we just // open a connection to the underlying URL. conn = Utils.newURL(path).openConnection(); } else { // First strip the resource name out of the path String urlString = ParserUtils.decode(path.substring(0, resourceDelimiterIndex)); // Note that we strip off the leading "/" because ZipFile.getEntry does // not expect it to be present. String entry = ParserUtils.decode(path.substring(resourceDelimiterIndex + 2)); // Since the URL we were passed may reference a file in a remote file system with // a UNC based name (\\Myhost\Mypath), we must take care to construct a new "host agnostic" // URL so that when we call getPath() on it we get the whole path, irregardless of whether // the resource is on a local or a remote file system. We will also now validate // our urlString has the proper "file" protocol prefix. URL jarURL = constructUNCTolerantURL("file", urlString); conn = new WSJarURLConnectionImpl(url, jarURL.getPath(), entry, zipCache); } return conn; }
java
@Override public URLConnection openConnection(URL url) throws IOException { String path = url.getPath(); int resourceDelimiterIndex = path.indexOf("!/"); URLConnection conn; if (resourceDelimiterIndex == -1) { // The "jar" protocol requires that the path contain an entry path. // For backwards compatibility, we do not. Instead, we just // open a connection to the underlying URL. conn = Utils.newURL(path).openConnection(); } else { // First strip the resource name out of the path String urlString = ParserUtils.decode(path.substring(0, resourceDelimiterIndex)); // Note that we strip off the leading "/" because ZipFile.getEntry does // not expect it to be present. String entry = ParserUtils.decode(path.substring(resourceDelimiterIndex + 2)); // Since the URL we were passed may reference a file in a remote file system with // a UNC based name (\\Myhost\Mypath), we must take care to construct a new "host agnostic" // URL so that when we call getPath() on it we get the whole path, irregardless of whether // the resource is on a local or a remote file system. We will also now validate // our urlString has the proper "file" protocol prefix. URL jarURL = constructUNCTolerantURL("file", urlString); conn = new WSJarURLConnectionImpl(url, jarURL.getPath(), entry, zipCache); } return conn; }
[ "@", "Override", "public", "URLConnection", "openConnection", "(", "URL", "url", ")", "throws", "IOException", "{", "String", "path", "=", "url", ".", "getPath", "(", ")", ";", "int", "resourceDelimiterIndex", "=", "path", ".", "indexOf", "(", "\"!/\"", ")", ";", "URLConnection", "conn", ";", "if", "(", "resourceDelimiterIndex", "==", "-", "1", ")", "{", "// The \"jar\" protocol requires that the path contain an entry path.", "// For backwards compatibility, we do not. Instead, we just", "// open a connection to the underlying URL.", "conn", "=", "Utils", ".", "newURL", "(", "path", ")", ".", "openConnection", "(", ")", ";", "}", "else", "{", "// First strip the resource name out of the path", "String", "urlString", "=", "ParserUtils", ".", "decode", "(", "path", ".", "substring", "(", "0", ",", "resourceDelimiterIndex", ")", ")", ";", "// Note that we strip off the leading \"/\" because ZipFile.getEntry does", "// not expect it to be present.", "String", "entry", "=", "ParserUtils", ".", "decode", "(", "path", ".", "substring", "(", "resourceDelimiterIndex", "+", "2", ")", ")", ";", "// Since the URL we were passed may reference a file in a remote file system with", "// a UNC based name (\\\\Myhost\\Mypath), we must take care to construct a new \"host agnostic\" ", "// URL so that when we call getPath() on it we get the whole path, irregardless of whether", "// the resource is on a local or a remote file system. We will also now validate ", "// our urlString has the proper \"file\" protocol prefix. ", "URL", "jarURL", "=", "constructUNCTolerantURL", "(", "\"file\"", ",", "urlString", ")", ";", "conn", "=", "new", "WSJarURLConnectionImpl", "(", "url", ",", "jarURL", ".", "getPath", "(", ")", ",", "entry", ",", "zipCache", ")", ";", "}", "return", "conn", ";", "}" ]
begin 408408.2
[ "begin", "408408", ".", "2" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.url/src/com/ibm/ws/artifact/url/internal/WSJarURLStreamHandler.java#L170-L200
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java
PubSubRealization.reconstitute
public void reconstitute( int startMode, HashMap<String, Object> durableSubscriptionsTable) throws SIIncorrectCallException, SIDiscriminatorSyntaxException, SISelectorSyntaxException, MessageStoreException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "reconstitute", new Object[] { new Integer(startMode), durableSubscriptionsTable }); // Reconstitute the static state initialise(false, durableSubscriptionsTable); // There should only be one messageItemStream in the BaseDestinationHandler. NonLockingCursor cursor = _baseDestinationHandler.newNonLockingItemStreamCursor( new ClassEqualsFilter(PubSubMessageItemStream.class)); _pubsubMessageItemStream = (PubSubMessageItemStream) cursor.next(); // Sanity - A BaseDestinationHandler should not be in the DestinationManager // without a PubSubMessageItemStream! if (_pubsubMessageItemStream == null) { SIErrorException e = new SIErrorException( nls.getFormattedMessage( "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048", new Object[] { _baseDestinationHandler.getName() }, null)); FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute", "1:458:1.35.2.4", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reconstitute", e); throw e; } cursor.finished(); _pubsubMessageItemStream.reconstitute(_baseDestinationHandler); _localisationManager.setLocal(); cursor = _pubsubMessageItemStream.newNonLockingReferenceStreamCursor( new ClassEqualsFilter(ProxyReferenceStream.class)); _proxyReferenceStream = (ProxyReferenceStream) cursor.next(); // Sanity - A BaseDestinationHandler should not be in the DestinationManager // without a ProxyReferenceStream in the pub/sub case! if (_proxyReferenceStream == null) { SIErrorException e = new SIErrorException( nls.getFormattedMessage( "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048", new Object[] { _baseDestinationHandler.getName() }, null)); FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute", "1:491:1.35.2.4", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reconstitute", e); throw e; } // PK62569 Increment the reference stream count on the pub/sub item stream // (the count is not persisted) to include the proxy reference stream. _pubsubMessageItemStream.incrementReferenceStreamCount(); cursor.finished(); createInputHandlersForPubSub(); // recover the durable subscriptions reconstituteDurableSubscriptions(); //Venu mock mock //comenting this out as there is no proxy handler for now. /* * // Call the event created on the Proxy handler code. * _messageProcessor.getProxyHandler().topicSpaceCreatedEvent( * _baseDestinationHandler); */ // Reconstitute source streams for PubSubInputHandler _pubSubRemoteSupport.reconstituteSourceStreams(startMode, null); // IMPORTANT: reconstitute remote durable state last so that // any local durable state has already been restored. _pubSubRemoteSupport. reconstituteRemoteDurable(startMode, _consumerDispatchersDurable); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reconstitute"); }
java
public void reconstitute( int startMode, HashMap<String, Object> durableSubscriptionsTable) throws SIIncorrectCallException, SIDiscriminatorSyntaxException, SISelectorSyntaxException, MessageStoreException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "reconstitute", new Object[] { new Integer(startMode), durableSubscriptionsTable }); // Reconstitute the static state initialise(false, durableSubscriptionsTable); // There should only be one messageItemStream in the BaseDestinationHandler. NonLockingCursor cursor = _baseDestinationHandler.newNonLockingItemStreamCursor( new ClassEqualsFilter(PubSubMessageItemStream.class)); _pubsubMessageItemStream = (PubSubMessageItemStream) cursor.next(); // Sanity - A BaseDestinationHandler should not be in the DestinationManager // without a PubSubMessageItemStream! if (_pubsubMessageItemStream == null) { SIErrorException e = new SIErrorException( nls.getFormattedMessage( "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048", new Object[] { _baseDestinationHandler.getName() }, null)); FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute", "1:458:1.35.2.4", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reconstitute", e); throw e; } cursor.finished(); _pubsubMessageItemStream.reconstitute(_baseDestinationHandler); _localisationManager.setLocal(); cursor = _pubsubMessageItemStream.newNonLockingReferenceStreamCursor( new ClassEqualsFilter(ProxyReferenceStream.class)); _proxyReferenceStream = (ProxyReferenceStream) cursor.next(); // Sanity - A BaseDestinationHandler should not be in the DestinationManager // without a ProxyReferenceStream in the pub/sub case! if (_proxyReferenceStream == null) { SIErrorException e = new SIErrorException( nls.getFormattedMessage( "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048", new Object[] { _baseDestinationHandler.getName() }, null)); FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute", "1:491:1.35.2.4", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reconstitute", e); throw e; } // PK62569 Increment the reference stream count on the pub/sub item stream // (the count is not persisted) to include the proxy reference stream. _pubsubMessageItemStream.incrementReferenceStreamCount(); cursor.finished(); createInputHandlersForPubSub(); // recover the durable subscriptions reconstituteDurableSubscriptions(); //Venu mock mock //comenting this out as there is no proxy handler for now. /* * // Call the event created on the Proxy handler code. * _messageProcessor.getProxyHandler().topicSpaceCreatedEvent( * _baseDestinationHandler); */ // Reconstitute source streams for PubSubInputHandler _pubSubRemoteSupport.reconstituteSourceStreams(startMode, null); // IMPORTANT: reconstitute remote durable state last so that // any local durable state has already been restored. _pubSubRemoteSupport. reconstituteRemoteDurable(startMode, _consumerDispatchersDurable); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reconstitute"); }
[ "public", "void", "reconstitute", "(", "int", "startMode", ",", "HashMap", "<", "String", ",", "Object", ">", "durableSubscriptionsTable", ")", "throws", "SIIncorrectCallException", ",", "SIDiscriminatorSyntaxException", ",", "SISelectorSyntaxException", ",", "MessageStoreException", ",", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"reconstitute\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "startMode", ")", ",", "durableSubscriptionsTable", "}", ")", ";", "// Reconstitute the static state", "initialise", "(", "false", ",", "durableSubscriptionsTable", ")", ";", "// There should only be one messageItemStream in the BaseDestinationHandler.", "NonLockingCursor", "cursor", "=", "_baseDestinationHandler", ".", "newNonLockingItemStreamCursor", "(", "new", "ClassEqualsFilter", "(", "PubSubMessageItemStream", ".", "class", ")", ")", ";", "_pubsubMessageItemStream", "=", "(", "PubSubMessageItemStream", ")", "cursor", ".", "next", "(", ")", ";", "// Sanity - A BaseDestinationHandler should not be in the DestinationManager", "// without a PubSubMessageItemStream!", "if", "(", "_pubsubMessageItemStream", "==", "null", ")", "{", "SIErrorException", "e", "=", "new", "SIErrorException", "(", "nls", ".", "getFormattedMessage", "(", "\"DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048\"", ",", "new", "Object", "[", "]", "{", "_baseDestinationHandler", ".", "getName", "(", ")", "}", ",", "null", ")", ")", ";", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute\"", ",", "\"1:458:1.35.2.4\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"reconstitute\"", ",", "e", ")", ";", "throw", "e", ";", "}", "cursor", ".", "finished", "(", ")", ";", "_pubsubMessageItemStream", ".", "reconstitute", "(", "_baseDestinationHandler", ")", ";", "_localisationManager", ".", "setLocal", "(", ")", ";", "cursor", "=", "_pubsubMessageItemStream", ".", "newNonLockingReferenceStreamCursor", "(", "new", "ClassEqualsFilter", "(", "ProxyReferenceStream", ".", "class", ")", ")", ";", "_proxyReferenceStream", "=", "(", "ProxyReferenceStream", ")", "cursor", ".", "next", "(", ")", ";", "// Sanity - A BaseDestinationHandler should not be in the DestinationManager", "// without a ProxyReferenceStream in the pub/sub case!", "if", "(", "_proxyReferenceStream", "==", "null", ")", "{", "SIErrorException", "e", "=", "new", "SIErrorException", "(", "nls", ".", "getFormattedMessage", "(", "\"DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048\"", ",", "new", "Object", "[", "]", "{", "_baseDestinationHandler", ".", "getName", "(", ")", "}", ",", "null", ")", ")", ";", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute\"", ",", "\"1:491:1.35.2.4\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"reconstitute\"", ",", "e", ")", ";", "throw", "e", ";", "}", "// PK62569 Increment the reference stream count on the pub/sub item stream", "// (the count is not persisted) to include the proxy reference stream.", "_pubsubMessageItemStream", ".", "incrementReferenceStreamCount", "(", ")", ";", "cursor", ".", "finished", "(", ")", ";", "createInputHandlersForPubSub", "(", ")", ";", "// recover the durable subscriptions", "reconstituteDurableSubscriptions", "(", ")", ";", "//Venu mock mock", "//comenting this out as there is no proxy handler for now. ", "/*\n * // Call the event created on the Proxy handler code.\n * _messageProcessor.getProxyHandler().topicSpaceCreatedEvent(\n * _baseDestinationHandler);\n */", "// Reconstitute source streams for PubSubInputHandler", "_pubSubRemoteSupport", ".", "reconstituteSourceStreams", "(", "startMode", ",", "null", ")", ";", "// IMPORTANT: reconstitute remote durable state last so that", "// any local durable state has already been restored.", "_pubSubRemoteSupport", ".", "reconstituteRemoteDurable", "(", "startMode", ",", "_consumerDispatchersDurable", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"reconstitute\"", ")", ";", "}" ]
There will only be one such proxy reference stream.
[ "There", "will", "only", "be", "one", "such", "proxy", "reference", "stream", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java#L293-L403
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java
PubSubRealization.createSubscriptionConsumerDispatcher
public ConsumerDispatcher createSubscriptionConsumerDispatcher(ConsumerDispatcherState subState) throws SIDiscriminatorSyntaxException, SISelectorSyntaxException, SIResourceException, SISelectorSyntaxException, SIDiscriminatorSyntaxException, SINonDurableSubscriptionMismatchException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createSubscriptionConsumerDispatcher", subState); ConsumerDispatcher cd = null; boolean isNewCDcreated = false; if (subState.getSubscriberID() == null) { //this is non-durable non shared scenario. i.e subscriber id is null. Then go ahead and create //consumer dispatcher and subscription item stream. cd = createSubscriptionItemStreamAndConsumerDispatcher(subState, false); } else { //this is non-durable shared scenario. //Check whether already subscriber present or not in hashamp cd = (ConsumerDispatcher) _destinationManager.getNondurableSharedSubscriptions().get(subState.getSubscriberID()); if (cd == null) { //consumer dispatcher is null.. means this is first consumer trying to create subscriber. //Go ahead and create consumer dispatcher and Subscription item stream. //we do not need to check for any flags like cloned because the call is from JMS2.0 explicitly //asking for subscriber to be shared. //_consumerDispatchersNonDurable is needed as the subscription creation has to be atomic synchronized (_destinationManager.getNondurableSharedSubscriptions()) { // this lock is too high level.. has to be further granularized. //again try to get cd for a given consumer as another thread might have created it first i.e got lock first after cd=null cd = (ConsumerDispatcher) _destinationManager.getNondurableSharedSubscriptions().get(subState.getSubscriberID()); if (cd == null) { cd = createSubscriptionItemStreamAndConsumerDispatcher(subState, true); isNewCDcreated = true; } } } } //check whether this is non-durable shared consumer and CD is prior created by //another consumer.. this consumer supposed to reuse it. if (!isNewCDcreated && (subState.getSubscriberID() != null)) { //check whether it is same topic and having topic selectors. if (!cd.getConsumerDispatcherState().equals(subState)) { // Found consumer dispatcher but only the IDs match, therefore cannot connect if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createSubscriptionConsumerDispatcher", subState); throw new SINonDurableSubscriptionMismatchException( nls.getFormattedMessage( "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createSubscriptionConsumerDispatcher", cd); return cd; }
java
public ConsumerDispatcher createSubscriptionConsumerDispatcher(ConsumerDispatcherState subState) throws SIDiscriminatorSyntaxException, SISelectorSyntaxException, SIResourceException, SISelectorSyntaxException, SIDiscriminatorSyntaxException, SINonDurableSubscriptionMismatchException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createSubscriptionConsumerDispatcher", subState); ConsumerDispatcher cd = null; boolean isNewCDcreated = false; if (subState.getSubscriberID() == null) { //this is non-durable non shared scenario. i.e subscriber id is null. Then go ahead and create //consumer dispatcher and subscription item stream. cd = createSubscriptionItemStreamAndConsumerDispatcher(subState, false); } else { //this is non-durable shared scenario. //Check whether already subscriber present or not in hashamp cd = (ConsumerDispatcher) _destinationManager.getNondurableSharedSubscriptions().get(subState.getSubscriberID()); if (cd == null) { //consumer dispatcher is null.. means this is first consumer trying to create subscriber. //Go ahead and create consumer dispatcher and Subscription item stream. //we do not need to check for any flags like cloned because the call is from JMS2.0 explicitly //asking for subscriber to be shared. //_consumerDispatchersNonDurable is needed as the subscription creation has to be atomic synchronized (_destinationManager.getNondurableSharedSubscriptions()) { // this lock is too high level.. has to be further granularized. //again try to get cd for a given consumer as another thread might have created it first i.e got lock first after cd=null cd = (ConsumerDispatcher) _destinationManager.getNondurableSharedSubscriptions().get(subState.getSubscriberID()); if (cd == null) { cd = createSubscriptionItemStreamAndConsumerDispatcher(subState, true); isNewCDcreated = true; } } } } //check whether this is non-durable shared consumer and CD is prior created by //another consumer.. this consumer supposed to reuse it. if (!isNewCDcreated && (subState.getSubscriberID() != null)) { //check whether it is same topic and having topic selectors. if (!cd.getConsumerDispatcherState().equals(subState)) { // Found consumer dispatcher but only the IDs match, therefore cannot connect if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createSubscriptionConsumerDispatcher", subState); throw new SINonDurableSubscriptionMismatchException( nls.getFormattedMessage( "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createSubscriptionConsumerDispatcher", cd); return cd; }
[ "public", "ConsumerDispatcher", "createSubscriptionConsumerDispatcher", "(", "ConsumerDispatcherState", "subState", ")", "throws", "SIDiscriminatorSyntaxException", ",", "SISelectorSyntaxException", ",", "SIResourceException", ",", "SISelectorSyntaxException", ",", "SIDiscriminatorSyntaxException", ",", "SINonDurableSubscriptionMismatchException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createSubscriptionConsumerDispatcher\"", ",", "subState", ")", ";", "ConsumerDispatcher", "cd", "=", "null", ";", "boolean", "isNewCDcreated", "=", "false", ";", "if", "(", "subState", ".", "getSubscriberID", "(", ")", "==", "null", ")", "{", "//this is non-durable non shared scenario. i.e subscriber id is null. Then go ahead and create", "//consumer dispatcher and subscription item stream.", "cd", "=", "createSubscriptionItemStreamAndConsumerDispatcher", "(", "subState", ",", "false", ")", ";", "}", "else", "{", "//this is non-durable shared scenario.", "//Check whether already subscriber present or not in hashamp", "cd", "=", "(", "ConsumerDispatcher", ")", "_destinationManager", ".", "getNondurableSharedSubscriptions", "(", ")", ".", "get", "(", "subState", ".", "getSubscriberID", "(", ")", ")", ";", "if", "(", "cd", "==", "null", ")", "{", "//consumer dispatcher is null.. means this is first consumer trying to create subscriber. ", "//Go ahead and create consumer dispatcher and Subscription item stream.", "//we do not need to check for any flags like cloned because the call is from JMS2.0 explicitly", "//asking for subscriber to be shared.", "//_consumerDispatchersNonDurable is needed as the subscription creation has to be atomic", "synchronized", "(", "_destinationManager", ".", "getNondurableSharedSubscriptions", "(", ")", ")", "{", "// this lock is too high level.. has to be further granularized.", "//again try to get cd for a given consumer as another thread might have created it first i.e got lock first after cd=null", "cd", "=", "(", "ConsumerDispatcher", ")", "_destinationManager", ".", "getNondurableSharedSubscriptions", "(", ")", ".", "get", "(", "subState", ".", "getSubscriberID", "(", ")", ")", ";", "if", "(", "cd", "==", "null", ")", "{", "cd", "=", "createSubscriptionItemStreamAndConsumerDispatcher", "(", "subState", ",", "true", ")", ";", "isNewCDcreated", "=", "true", ";", "}", "}", "}", "}", "//check whether this is non-durable shared consumer and CD is prior created by", "//another consumer.. this consumer supposed to reuse it.", "if", "(", "!", "isNewCDcreated", "&&", "(", "subState", ".", "getSubscriberID", "(", ")", "!=", "null", ")", ")", "{", "//check whether it is same topic and having topic selectors.", "if", "(", "!", "cd", ".", "getConsumerDispatcherState", "(", ")", ".", "equals", "(", "subState", ")", ")", "{", "// Found consumer dispatcher but only the IDs match, therefore cannot connect", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createSubscriptionConsumerDispatcher\"", ",", "subState", ")", ";", "throw", "new", "SINonDurableSubscriptionMismatchException", "(", "nls", ".", "getFormattedMessage", "(", "\"SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143\"", ",", "new", "Object", "[", "]", "{", "subState", ".", "getSubscriberID", "(", ")", ",", "_messageProcessor", ".", "getMessagingEngineName", "(", ")", "}", ",", "null", ")", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createSubscriptionConsumerDispatcher\"", ",", "cd", ")", ";", "return", "cd", ";", "}" ]
however nobody is calling this thru AbstractAliasDestinationHandler in Liberty.
[ "however", "nobody", "is", "calling", "this", "thru", "AbstractAliasDestinationHandler", "in", "Liberty", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java#L693-L759
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java
PubSubRealization.attachToLocalDurableSubscription
public ConsumableKey attachToLocalDurableSubscription( LocalConsumerPoint consumerPoint, ConsumerDispatcherState subState) throws SIDurableSubscriptionMismatchException, SIDurableSubscriptionNotFoundException, SIDestinationLockedException, SISelectorSyntaxException, SIDiscriminatorSyntaxException, SINotPossibleInCurrentConfigurationException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "attachToLocalDurableSubscription", new Object[] { consumerPoint, subState }); ConsumerDispatcher consumerDispatcher = null; ConsumableKey data = null; /* * Lock the list of durable subscriptions to prevent others creating/using an * identical subscription */ synchronized (_consumerDispatchersDurable) { /* * Get the consumerDispatcher. If it does not exist then we create it. If it exists * already and is EXACTLY the same, then we connect to it. If it exists but only * the same in ID then throw exception. */ consumerDispatcher = getDurableSubscriptionConsumerDispatcher(subState); if (consumerDispatcher != null) { // If subscription already has consumers attached then reject the create // unless we are setting up a cloned subscriber. if (consumerDispatcher.hasConsumersAttached() && !subState.isCloned()) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "attachToLocalDurableSubscription", "Consumers already attached"); throw new SIDestinationLockedException( nls.getFormattedMessage( "SUBSCRIPTION_IN_USE_ERROR_CWSIP0152", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } // Attach to the consumerDispatcher if it is EXACTLY the same if (!consumerDispatcher.getConsumerDispatcherState().isReady() || !consumerDispatcher.getConsumerDispatcherState().equals(subState)) { // Found consumer dispatcher but only the IDs match, therefore cannot connect if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attachToLocalDurableSubscription", subState); throw new SIDurableSubscriptionMismatchException( nls.getFormattedMessage( "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } // If security is enabled, then check the user who is attempting // to attach matches the user who created the durable sub. if (_messageProcessor.isBusSecure()) { if (!consumerDispatcher .getConsumerDispatcherState() .equalUser(subState)) { // Users don't match if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attachToLocalDurableSubscription", subState); throw new SIDurableSubscriptionMismatchException( nls.getFormattedMessage( "USER_NOT_AUTH_ACTIVATE_ERROR_CWSIP0312", new Object[] { subState.getUser(), subState.getSubscriberID(), _baseDestinationHandler.getName() }, null)); } } // Attach the consumerpoint to the subscription. data = (ConsumableKey) consumerDispatcher.attachConsumerPoint( consumerPoint, null, consumerPoint.getConsumerSession().getConnectionUuid(), consumerPoint.getConsumerSession().getReadAhead(), consumerPoint.getConsumerSession().getForwardScanning(), null); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "attachToLocalDurableSubscription", "SIDurableSubscriptionNotFoundException"); throw new SIDurableSubscriptionNotFoundException( nls.getFormattedMessage( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attachToLocalDurableSubscription", data); return data; }
java
public ConsumableKey attachToLocalDurableSubscription( LocalConsumerPoint consumerPoint, ConsumerDispatcherState subState) throws SIDurableSubscriptionMismatchException, SIDurableSubscriptionNotFoundException, SIDestinationLockedException, SISelectorSyntaxException, SIDiscriminatorSyntaxException, SINotPossibleInCurrentConfigurationException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "attachToLocalDurableSubscription", new Object[] { consumerPoint, subState }); ConsumerDispatcher consumerDispatcher = null; ConsumableKey data = null; /* * Lock the list of durable subscriptions to prevent others creating/using an * identical subscription */ synchronized (_consumerDispatchersDurable) { /* * Get the consumerDispatcher. If it does not exist then we create it. If it exists * already and is EXACTLY the same, then we connect to it. If it exists but only * the same in ID then throw exception. */ consumerDispatcher = getDurableSubscriptionConsumerDispatcher(subState); if (consumerDispatcher != null) { // If subscription already has consumers attached then reject the create // unless we are setting up a cloned subscriber. if (consumerDispatcher.hasConsumersAttached() && !subState.isCloned()) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "attachToLocalDurableSubscription", "Consumers already attached"); throw new SIDestinationLockedException( nls.getFormattedMessage( "SUBSCRIPTION_IN_USE_ERROR_CWSIP0152", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } // Attach to the consumerDispatcher if it is EXACTLY the same if (!consumerDispatcher.getConsumerDispatcherState().isReady() || !consumerDispatcher.getConsumerDispatcherState().equals(subState)) { // Found consumer dispatcher but only the IDs match, therefore cannot connect if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attachToLocalDurableSubscription", subState); throw new SIDurableSubscriptionMismatchException( nls.getFormattedMessage( "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } // If security is enabled, then check the user who is attempting // to attach matches the user who created the durable sub. if (_messageProcessor.isBusSecure()) { if (!consumerDispatcher .getConsumerDispatcherState() .equalUser(subState)) { // Users don't match if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attachToLocalDurableSubscription", subState); throw new SIDurableSubscriptionMismatchException( nls.getFormattedMessage( "USER_NOT_AUTH_ACTIVATE_ERROR_CWSIP0312", new Object[] { subState.getUser(), subState.getSubscriberID(), _baseDestinationHandler.getName() }, null)); } } // Attach the consumerpoint to the subscription. data = (ConsumableKey) consumerDispatcher.attachConsumerPoint( consumerPoint, null, consumerPoint.getConsumerSession().getConnectionUuid(), consumerPoint.getConsumerSession().getReadAhead(), consumerPoint.getConsumerSession().getForwardScanning(), null); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "attachToLocalDurableSubscription", "SIDurableSubscriptionNotFoundException"); throw new SIDurableSubscriptionNotFoundException( nls.getFormattedMessage( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146", new Object[] { subState.getSubscriberID(), _messageProcessor.getMessagingEngineName() }, null)); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "attachToLocalDurableSubscription", data); return data; }
[ "public", "ConsumableKey", "attachToLocalDurableSubscription", "(", "LocalConsumerPoint", "consumerPoint", ",", "ConsumerDispatcherState", "subState", ")", "throws", "SIDurableSubscriptionMismatchException", ",", "SIDurableSubscriptionNotFoundException", ",", "SIDestinationLockedException", ",", "SISelectorSyntaxException", ",", "SIDiscriminatorSyntaxException", ",", "SINotPossibleInCurrentConfigurationException", ",", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"attachToLocalDurableSubscription\"", ",", "new", "Object", "[", "]", "{", "consumerPoint", ",", "subState", "}", ")", ";", "ConsumerDispatcher", "consumerDispatcher", "=", "null", ";", "ConsumableKey", "data", "=", "null", ";", "/*\n * Lock the list of durable subscriptions to prevent others creating/using an\n * identical subscription\n */", "synchronized", "(", "_consumerDispatchersDurable", ")", "{", "/*\n * Get the consumerDispatcher. If it does not exist then we create it. If it exists\n * already and is EXACTLY the same, then we connect to it. If it exists but only\n * the same in ID then throw exception.\n */", "consumerDispatcher", "=", "getDurableSubscriptionConsumerDispatcher", "(", "subState", ")", ";", "if", "(", "consumerDispatcher", "!=", "null", ")", "{", "// If subscription already has consumers attached then reject the create", "// unless we are setting up a cloned subscriber.", "if", "(", "consumerDispatcher", ".", "hasConsumersAttached", "(", ")", "&&", "!", "subState", ".", "isCloned", "(", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"attachToLocalDurableSubscription\"", ",", "\"Consumers already attached\"", ")", ";", "throw", "new", "SIDestinationLockedException", "(", "nls", ".", "getFormattedMessage", "(", "\"SUBSCRIPTION_IN_USE_ERROR_CWSIP0152\"", ",", "new", "Object", "[", "]", "{", "subState", ".", "getSubscriberID", "(", ")", ",", "_messageProcessor", ".", "getMessagingEngineName", "(", ")", "}", ",", "null", ")", ")", ";", "}", "// Attach to the consumerDispatcher if it is EXACTLY the same", "if", "(", "!", "consumerDispatcher", ".", "getConsumerDispatcherState", "(", ")", ".", "isReady", "(", ")", "||", "!", "consumerDispatcher", ".", "getConsumerDispatcherState", "(", ")", ".", "equals", "(", "subState", ")", ")", "{", "// Found consumer dispatcher but only the IDs match, therefore cannot connect", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"attachToLocalDurableSubscription\"", ",", "subState", ")", ";", "throw", "new", "SIDurableSubscriptionMismatchException", "(", "nls", ".", "getFormattedMessage", "(", "\"SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143\"", ",", "new", "Object", "[", "]", "{", "subState", ".", "getSubscriberID", "(", ")", ",", "_messageProcessor", ".", "getMessagingEngineName", "(", ")", "}", ",", "null", ")", ")", ";", "}", "// If security is enabled, then check the user who is attempting", "// to attach matches the user who created the durable sub.", "if", "(", "_messageProcessor", ".", "isBusSecure", "(", ")", ")", "{", "if", "(", "!", "consumerDispatcher", ".", "getConsumerDispatcherState", "(", ")", ".", "equalUser", "(", "subState", ")", ")", "{", "// Users don't match", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"attachToLocalDurableSubscription\"", ",", "subState", ")", ";", "throw", "new", "SIDurableSubscriptionMismatchException", "(", "nls", ".", "getFormattedMessage", "(", "\"USER_NOT_AUTH_ACTIVATE_ERROR_CWSIP0312\"", ",", "new", "Object", "[", "]", "{", "subState", ".", "getUser", "(", ")", ",", "subState", ".", "getSubscriberID", "(", ")", ",", "_baseDestinationHandler", ".", "getName", "(", ")", "}", ",", "null", ")", ")", ";", "}", "}", "// Attach the consumerpoint to the subscription.", "data", "=", "(", "ConsumableKey", ")", "consumerDispatcher", ".", "attachConsumerPoint", "(", "consumerPoint", ",", "null", ",", "consumerPoint", ".", "getConsumerSession", "(", ")", ".", "getConnectionUuid", "(", ")", ",", "consumerPoint", ".", "getConsumerSession", "(", ")", ".", "getReadAhead", "(", ")", ",", "consumerPoint", ".", "getConsumerSession", "(", ")", ".", "getForwardScanning", "(", ")", ",", "null", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"attachToLocalDurableSubscription\"", ",", "\"SIDurableSubscriptionNotFoundException\"", ")", ";", "throw", "new", "SIDurableSubscriptionNotFoundException", "(", "nls", ".", "getFormattedMessage", "(", "\"SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146\"", ",", "new", "Object", "[", "]", "{", "subState", ".", "getSubscriberID", "(", ")", ",", "_messageProcessor", ".", "getMessagingEngineName", "(", ")", "}", ",", "null", ")", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"attachToLocalDurableSubscription\"", ",", "data", ")", ";", "return", "data", ";", "}" ]
Attaches to a created DurableSubscription which is homed on the local ME. @param consumerPoint The consumer point to attach. @param subState The ConsumerDispatcherState describing the subscription.
[ "Attaches", "to", "a", "created", "DurableSubscription", "which", "is", "homed", "on", "the", "local", "ME", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java#L1304-L1428
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java
PubSubRealization.getSubscriptionIndex
public SubscriptionIndex getSubscriptionIndex() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getSubscriptionIndex"); SibTr.exit(tc, "getSubscriptionIndex", _subscriptionIndex); } return _subscriptionIndex; }
java
public SubscriptionIndex getSubscriptionIndex() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getSubscriptionIndex"); SibTr.exit(tc, "getSubscriptionIndex", _subscriptionIndex); } return _subscriptionIndex; }
[ "public", "SubscriptionIndex", "getSubscriptionIndex", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "tc", ",", "\"getSubscriptionIndex\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"getSubscriptionIndex\"", ",", "_subscriptionIndex", ")", ";", "}", "return", "_subscriptionIndex", ";", "}" ]
Retrieve the subscription index for this destination. @return SubscriptionIndex.
[ "Retrieve", "the", "subscription", "index", "for", "this", "destination", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java#L2052-L2060
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java
PubSubRealization.checkDurableSubStillValid
private boolean checkDurableSubStillValid(DurableSubscriptionItemStream durableSub) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkDurableSubStillValid", durableSub); boolean valid = false; ConsumerDispatcherState cdState = durableSub.getConsumerDispatcherState(); if (durableSub.isToBeDeleted()) { valid = false; _destinationManager.addSubscriptionToDelete(durableSub); } else if (cdState.getTopicSpaceUuid().equals(_baseDestinationHandler.getUuid())) { //The subscription was made through the topicspace directly //(most likely case) valid = true; } else { //The subscription must have been made through an alias. Check its //still valid try { // Get the admin version since otherwise the target will not have been // resolved yet. BaseDestinationDefinition dh = _destinationManager.getLocalME() .getMessagingEngine() .getSIBDestination(cdState.getTopicSpaceBusName(), cdState.getTopicSpaceName()); if (dh.getUUID().equals(cdState.getTopicSpaceUuid())) { valid = true; } else { //The alias has a different uuid, so the old alias must have been deleted // Remove the persistent state of the durable subscription durableSub.markAsToBeDeleted(); try { durableSub.requestUpdate( _messageProcessor.getTXManager().createAutoCommitTransaction()); } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3667:1.35.2.4", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "checkDurableSubStillValid", "SIResourceException - Failed to update durable sub to delete."); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3684:1.35.2.4", e }, null)); } durableSub.deleteIfPossible(false); // Send the subscription deleted event message to the Neighbours // sanjay liberty change // _messageProcessor.getProxyHandler().unsubscribeEvent( // cdState, // _baseDestinationHandler.getTransactionManager().createAutoCommitTransaction(), // true); } } catch (SIBExceptionBase e) { // No FFDC code needed // Remove the persistent state of the durable subscription durableSub.markAsToBeDeleted(); try { durableSub.requestUpdate( _messageProcessor.getTXManager().createAutoCommitTransaction()); } catch (MessageStoreException e1) { // FFDC FFDCFilter.processException( e1, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3712:1.35.2.4", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "checkDurableSubStillValid", "SIResourceException - Failed to update durable sub to delete."); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3729:1.35.2.4", e }, null)); } durableSub.deleteIfPossible(false); // Send the subscription deleted event message to the Neighbours _messageProcessor.getProxyHandler().unsubscribeEvent( cdState, _baseDestinationHandler.getTransactionManager().createAutoCommitTransaction(), true); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkDurableSubStillValid", new Boolean(valid)); return valid; }
java
private boolean checkDurableSubStillValid(DurableSubscriptionItemStream durableSub) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkDurableSubStillValid", durableSub); boolean valid = false; ConsumerDispatcherState cdState = durableSub.getConsumerDispatcherState(); if (durableSub.isToBeDeleted()) { valid = false; _destinationManager.addSubscriptionToDelete(durableSub); } else if (cdState.getTopicSpaceUuid().equals(_baseDestinationHandler.getUuid())) { //The subscription was made through the topicspace directly //(most likely case) valid = true; } else { //The subscription must have been made through an alias. Check its //still valid try { // Get the admin version since otherwise the target will not have been // resolved yet. BaseDestinationDefinition dh = _destinationManager.getLocalME() .getMessagingEngine() .getSIBDestination(cdState.getTopicSpaceBusName(), cdState.getTopicSpaceName()); if (dh.getUUID().equals(cdState.getTopicSpaceUuid())) { valid = true; } else { //The alias has a different uuid, so the old alias must have been deleted // Remove the persistent state of the durable subscription durableSub.markAsToBeDeleted(); try { durableSub.requestUpdate( _messageProcessor.getTXManager().createAutoCommitTransaction()); } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3667:1.35.2.4", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "checkDurableSubStillValid", "SIResourceException - Failed to update durable sub to delete."); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3684:1.35.2.4", e }, null)); } durableSub.deleteIfPossible(false); // Send the subscription deleted event message to the Neighbours // sanjay liberty change // _messageProcessor.getProxyHandler().unsubscribeEvent( // cdState, // _baseDestinationHandler.getTransactionManager().createAutoCommitTransaction(), // true); } } catch (SIBExceptionBase e) { // No FFDC code needed // Remove the persistent state of the durable subscription durableSub.markAsToBeDeleted(); try { durableSub.requestUpdate( _messageProcessor.getTXManager().createAutoCommitTransaction()); } catch (MessageStoreException e1) { // FFDC FFDCFilter.processException( e1, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3712:1.35.2.4", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit( tc, "checkDurableSubStillValid", "SIResourceException - Failed to update durable sub to delete."); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid", "1:3729:1.35.2.4", e }, null)); } durableSub.deleteIfPossible(false); // Send the subscription deleted event message to the Neighbours _messageProcessor.getProxyHandler().unsubscribeEvent( cdState, _baseDestinationHandler.getTransactionManager().createAutoCommitTransaction(), true); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkDurableSubStillValid", new Boolean(valid)); return valid; }
[ "private", "boolean", "checkDurableSubStillValid", "(", "DurableSubscriptionItemStream", "durableSub", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"checkDurableSubStillValid\"", ",", "durableSub", ")", ";", "boolean", "valid", "=", "false", ";", "ConsumerDispatcherState", "cdState", "=", "durableSub", ".", "getConsumerDispatcherState", "(", ")", ";", "if", "(", "durableSub", ".", "isToBeDeleted", "(", ")", ")", "{", "valid", "=", "false", ";", "_destinationManager", ".", "addSubscriptionToDelete", "(", "durableSub", ")", ";", "}", "else", "if", "(", "cdState", ".", "getTopicSpaceUuid", "(", ")", ".", "equals", "(", "_baseDestinationHandler", ".", "getUuid", "(", ")", ")", ")", "{", "//The subscription was made through the topicspace directly", "//(most likely case)", "valid", "=", "true", ";", "}", "else", "{", "//The subscription must have been made through an alias. Check its", "//still valid", "try", "{", "// Get the admin version since otherwise the target will not have been", "// resolved yet.", "BaseDestinationDefinition", "dh", "=", "_destinationManager", ".", "getLocalME", "(", ")", ".", "getMessagingEngine", "(", ")", ".", "getSIBDestination", "(", "cdState", ".", "getTopicSpaceBusName", "(", ")", ",", "cdState", ".", "getTopicSpaceName", "(", ")", ")", ";", "if", "(", "dh", ".", "getUUID", "(", ")", ".", "equals", "(", "cdState", ".", "getTopicSpaceUuid", "(", ")", ")", ")", "{", "valid", "=", "true", ";", "}", "else", "{", "//The alias has a different uuid, so the old alias must have been deleted", "// Remove the persistent state of the durable subscription", "durableSub", ".", "markAsToBeDeleted", "(", ")", ";", "try", "{", "durableSub", ".", "requestUpdate", "(", "_messageProcessor", ".", "getTXManager", "(", ")", ".", "createAutoCommitTransaction", "(", ")", ")", ";", "}", "catch", "(", "MessageStoreException", "e", ")", "{", "// FFDC", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid\"", ",", "\"1:3667:1.35.2.4\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"checkDurableSubStillValid\"", ",", "\"SIResourceException - Failed to update durable sub to delete.\"", ")", ";", "throw", "new", "SIResourceException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid\"", ",", "\"1:3684:1.35.2.4\"", ",", "e", "}", ",", "null", ")", ")", ";", "}", "durableSub", ".", "deleteIfPossible", "(", "false", ")", ";", "// Send the subscription deleted event message to the Neighbours", "// sanjay liberty change", "// _messageProcessor.getProxyHandler().unsubscribeEvent(", "// cdState,", "// _baseDestinationHandler.getTransactionManager().createAutoCommitTransaction(),", "// true);", "}", "}", "catch", "(", "SIBExceptionBase", "e", ")", "{", "// No FFDC code needed", "// Remove the persistent state of the durable subscription", "durableSub", ".", "markAsToBeDeleted", "(", ")", ";", "try", "{", "durableSub", ".", "requestUpdate", "(", "_messageProcessor", ".", "getTXManager", "(", ")", ".", "createAutoCommitTransaction", "(", ")", ")", ";", "}", "catch", "(", "MessageStoreException", "e1", ")", "{", "// FFDC", "FFDCFilter", ".", "processException", "(", "e1", ",", "\"com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid\"", ",", "\"1:3712:1.35.2.4\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"checkDurableSubStillValid\"", ",", "\"SIResourceException - Failed to update durable sub to delete.\"", ")", ";", "throw", "new", "SIResourceException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid\"", ",", "\"1:3729:1.35.2.4\"", ",", "e", "}", ",", "null", ")", ")", ";", "}", "durableSub", ".", "deleteIfPossible", "(", "false", ")", ";", "// Send the subscription deleted event message to the Neighbours", "_messageProcessor", ".", "getProxyHandler", "(", ")", ".", "unsubscribeEvent", "(", "cdState", ",", "_baseDestinationHandler", ".", "getTransactionManager", "(", ")", ".", "createAutoCommitTransaction", "(", ")", ",", "true", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"checkDurableSubStillValid\"", ",", "new", "Boolean", "(", "valid", ")", ")", ";", "return", "valid", ";", "}" ]
Ensure that if the durable sub was made through an alias, then the alias still exists @param durableSub @return true if the durable sub is valid, false if it wasnt and has bee] removed
[ "Ensure", "that", "if", "the", "durable", "sub", "was", "made", "through", "an", "alias", "then", "the", "alias", "still", "exists" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java#L3675-L3808
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java
PubSubRealization.retrieveMessageFromItemStream
public MessageItem retrieveMessageFromItemStream(long msgStoreID) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "retrieveMessageFromItemStream", new Long(msgStoreID)); MessageItem msgItem = null; try { msgItem = (MessageItem) _pubsubMessageItemStream.findById(msgStoreID); } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.retrieveMessageFromItemStream", "1:3797:1.35.2.4", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "retrieveMessageFromItemStream", e); throw new SIResourceException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "retrieveMessageFromItemStream", msgItem); return msgItem; }
java
public MessageItem retrieveMessageFromItemStream(long msgStoreID) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "retrieveMessageFromItemStream", new Long(msgStoreID)); MessageItem msgItem = null; try { msgItem = (MessageItem) _pubsubMessageItemStream.findById(msgStoreID); } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.retrieveMessageFromItemStream", "1:3797:1.35.2.4", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "retrieveMessageFromItemStream", e); throw new SIResourceException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "retrieveMessageFromItemStream", msgItem); return msgItem; }
[ "public", "MessageItem", "retrieveMessageFromItemStream", "(", "long", "msgStoreID", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"retrieveMessageFromItemStream\"", ",", "new", "Long", "(", "msgStoreID", ")", ")", ";", "MessageItem", "msgItem", "=", "null", ";", "try", "{", "msgItem", "=", "(", "MessageItem", ")", "_pubsubMessageItemStream", ".", "findById", "(", "msgStoreID", ")", ";", "}", "catch", "(", "MessageStoreException", "e", ")", "{", "// FFDC", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.destination.PubSubRealization.retrieveMessageFromItemStream\"", ",", "\"1:3797:1.35.2.4\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"retrieveMessageFromItemStream\"", ",", "e", ")", ";", "throw", "new", "SIResourceException", "(", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"retrieveMessageFromItemStream\"", ",", "msgItem", ")", ";", "return", "msgItem", ";", "}" ]
Retrieve the message from the non-persistent ItemStream
[ "Retrieve", "the", "message", "from", "the", "non", "-", "persistent", "ItemStream" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/destination/PubSubRealization.java#L3839-L3870
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx/src/com/ibm/ws/jmx/internal/MBeanUtil.java
MBeanUtil.getRegisterableMBean
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Object getRegisterableMBean(ServiceReference<?> serviceReference, Object mBean) throws NotCompliantMBeanException { // String methodName = "getRegisterableMBean"; // System.out.println(methodName + ": ENTER: MBean [ " + mBean + " ]"); // Follows the algorithm used by Apache Aries for registering MBeans. // REVISIT: The read-only restriction might be relaxed if and when security // support is added to JMX. if ( mBean instanceof DynamicMBean ) { // System.out.println(methodName + ": RETURN : MBean [ " + mBean + " ] (DynamicMBean)"); return mBean; } else if ( mBean instanceof ConfigurationAdminMBean ) { Object readOnlyMBean = new ReadOnlyConfigurationAdmin((ConfigurationAdminMBean) mBean); // System.out.println(methodName + ": RETURN : MBean [ " + readOnlyMBean + " ] (ConfigurationAdminBean)"); return readOnlyMBean; } Class<?> fallbackInterface = null; Class<?> mBeanClass = mBean.getClass(); String directInterfaceName = mBeanClass.getName() + "MBean"; List<String> publishedInterfaceNames = Arrays.asList((String[]) serviceReference.getProperty(Constants.OBJECTCLASS)); // for ( String publishedName : publishedInterfaceNames ) { // System.out.println(methodName + ": Published [ " + publishedName + " ]"); // } for ( Class<?> nextInterface : mBeanClass.getInterfaces() ) { String nextInterfaceName = nextInterface.getName(); // Skip any interface which is not published. if ( !publishedInterfaceNames.contains(nextInterfaceName) ) { // System.out.println(methodName + ": Candidate interface [ " + nextInterfaceName + " ]: Skip, not published"); continue; } // Immediate case: Match on the bean class name and ends with "MBean". if ( nextInterfaceName.equals(directInterfaceName) ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] Direct match on interface [ " + nextInterfaceName + " ]"); return mBean; } // Immediate case: Match on interface tagged with "@MXBean(true)". // Immediate case: Match on an interface not tagged with "@MXBean(false)" // and which ends with "MXBean". MXBean mxbean = nextInterface.getAnnotation(MXBean.class); if ( mxbean != null ) { if ( mxbean.value() ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] Direct match on @MXBean [ " + nextInterfaceName + " ]"); return mBean; } else { // System.out.println(methodName + ": Ignoring interface [ " + nextInterfaceName + " ] with @MXBean(false)"); // "@MXBean(false)" } } else { if ( nextInterfaceName.endsWith("MXBean") ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] Direct match on MXBean [ " + nextInterfaceName + " ]"); return mBean; } } // Secondary case: Not a match on bean class name but ending with // "MBean". Use as a fall back if the none of the immediate cases // triggers. if ( nextInterfaceName.endsWith("MBean") ) { // System.out.println(methodName + ": Partial match on interface [ " + nextInterfaceName + " ]"); fallbackInterface = nextInterface; // Do NOT return immediately. } } // REVISIT: The object wasn't of the form we were expecting though // might still be an MBean. For now let's reject it. We can support // more types of MBeans later. if ( fallbackInterface == null ) { // System.out.println(methodName + ": Failing with NonCompliantMBeanException"); StringBuilder errorMessage = new StringBuilder(); errorMessage.append("Unregisterable MBean: [ " + mBeanClass.getName() + " ]"); for ( Class<?> nextInterface : mBeanClass.getInterfaces() ) { errorMessage.append(" implements [ " + nextInterface.getName() + " ]"); } for ( String publishedName : (String[]) serviceReference.getProperty(Constants.OBJECTCLASS) ) { errorMessage.append(" published [ " + publishedName + " ]"); } throw new NotCompliantMBeanException(errorMessage.toString()); } Object standardMBean; if ( mBean instanceof NotificationEmitter ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] (Standard Emitter MBean)"); standardMBean = new StandardEmitterMBean(mBean, (Class) fallbackInterface, (NotificationEmitter) mBean); } else { // System.out.println(methodName + ": RETURN [ " + mBean + " ] (Standard MBean)"); standardMBean = new StandardMBean(mBean, (Class) fallbackInterface); } return standardMBean; }
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public static Object getRegisterableMBean(ServiceReference<?> serviceReference, Object mBean) throws NotCompliantMBeanException { // String methodName = "getRegisterableMBean"; // System.out.println(methodName + ": ENTER: MBean [ " + mBean + " ]"); // Follows the algorithm used by Apache Aries for registering MBeans. // REVISIT: The read-only restriction might be relaxed if and when security // support is added to JMX. if ( mBean instanceof DynamicMBean ) { // System.out.println(methodName + ": RETURN : MBean [ " + mBean + " ] (DynamicMBean)"); return mBean; } else if ( mBean instanceof ConfigurationAdminMBean ) { Object readOnlyMBean = new ReadOnlyConfigurationAdmin((ConfigurationAdminMBean) mBean); // System.out.println(methodName + ": RETURN : MBean [ " + readOnlyMBean + " ] (ConfigurationAdminBean)"); return readOnlyMBean; } Class<?> fallbackInterface = null; Class<?> mBeanClass = mBean.getClass(); String directInterfaceName = mBeanClass.getName() + "MBean"; List<String> publishedInterfaceNames = Arrays.asList((String[]) serviceReference.getProperty(Constants.OBJECTCLASS)); // for ( String publishedName : publishedInterfaceNames ) { // System.out.println(methodName + ": Published [ " + publishedName + " ]"); // } for ( Class<?> nextInterface : mBeanClass.getInterfaces() ) { String nextInterfaceName = nextInterface.getName(); // Skip any interface which is not published. if ( !publishedInterfaceNames.contains(nextInterfaceName) ) { // System.out.println(methodName + ": Candidate interface [ " + nextInterfaceName + " ]: Skip, not published"); continue; } // Immediate case: Match on the bean class name and ends with "MBean". if ( nextInterfaceName.equals(directInterfaceName) ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] Direct match on interface [ " + nextInterfaceName + " ]"); return mBean; } // Immediate case: Match on interface tagged with "@MXBean(true)". // Immediate case: Match on an interface not tagged with "@MXBean(false)" // and which ends with "MXBean". MXBean mxbean = nextInterface.getAnnotation(MXBean.class); if ( mxbean != null ) { if ( mxbean.value() ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] Direct match on @MXBean [ " + nextInterfaceName + " ]"); return mBean; } else { // System.out.println(methodName + ": Ignoring interface [ " + nextInterfaceName + " ] with @MXBean(false)"); // "@MXBean(false)" } } else { if ( nextInterfaceName.endsWith("MXBean") ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] Direct match on MXBean [ " + nextInterfaceName + " ]"); return mBean; } } // Secondary case: Not a match on bean class name but ending with // "MBean". Use as a fall back if the none of the immediate cases // triggers. if ( nextInterfaceName.endsWith("MBean") ) { // System.out.println(methodName + ": Partial match on interface [ " + nextInterfaceName + " ]"); fallbackInterface = nextInterface; // Do NOT return immediately. } } // REVISIT: The object wasn't of the form we were expecting though // might still be an MBean. For now let's reject it. We can support // more types of MBeans later. if ( fallbackInterface == null ) { // System.out.println(methodName + ": Failing with NonCompliantMBeanException"); StringBuilder errorMessage = new StringBuilder(); errorMessage.append("Unregisterable MBean: [ " + mBeanClass.getName() + " ]"); for ( Class<?> nextInterface : mBeanClass.getInterfaces() ) { errorMessage.append(" implements [ " + nextInterface.getName() + " ]"); } for ( String publishedName : (String[]) serviceReference.getProperty(Constants.OBJECTCLASS) ) { errorMessage.append(" published [ " + publishedName + " ]"); } throw new NotCompliantMBeanException(errorMessage.toString()); } Object standardMBean; if ( mBean instanceof NotificationEmitter ) { // System.out.println(methodName + ": RETURN [ " + mBean + " ] (Standard Emitter MBean)"); standardMBean = new StandardEmitterMBean(mBean, (Class) fallbackInterface, (NotificationEmitter) mBean); } else { // System.out.println(methodName + ": RETURN [ " + mBean + " ] (Standard MBean)"); standardMBean = new StandardMBean(mBean, (Class) fallbackInterface); } return standardMBean; }
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "static", "Object", "getRegisterableMBean", "(", "ServiceReference", "<", "?", ">", "serviceReference", ",", "Object", "mBean", ")", "throws", "NotCompliantMBeanException", "{", "// String methodName = \"getRegisterableMBean\";", "// System.out.println(methodName + \": ENTER: MBean [ \" + mBean + \" ]\");", "// Follows the algorithm used by Apache Aries for registering MBeans.", "// REVISIT: The read-only restriction might be relaxed if and when security", "// support is added to JMX.", "if", "(", "mBean", "instanceof", "DynamicMBean", ")", "{", "// System.out.println(methodName + \": RETURN : MBean [ \" + mBean + \" ] (DynamicMBean)\");", "return", "mBean", ";", "}", "else", "if", "(", "mBean", "instanceof", "ConfigurationAdminMBean", ")", "{", "Object", "readOnlyMBean", "=", "new", "ReadOnlyConfigurationAdmin", "(", "(", "ConfigurationAdminMBean", ")", "mBean", ")", ";", "// System.out.println(methodName + \": RETURN : MBean [ \" + readOnlyMBean + \" ] (ConfigurationAdminBean)\"); ", "return", "readOnlyMBean", ";", "}", "Class", "<", "?", ">", "fallbackInterface", "=", "null", ";", "Class", "<", "?", ">", "mBeanClass", "=", "mBean", ".", "getClass", "(", ")", ";", "String", "directInterfaceName", "=", "mBeanClass", ".", "getName", "(", ")", "+", "\"MBean\"", ";", "List", "<", "String", ">", "publishedInterfaceNames", "=", "Arrays", ".", "asList", "(", "(", "String", "[", "]", ")", "serviceReference", ".", "getProperty", "(", "Constants", ".", "OBJECTCLASS", ")", ")", ";", "// for ( String publishedName : publishedInterfaceNames ) {", "// System.out.println(methodName + \": Published [ \" + publishedName + \" ]\");", "// }", "for", "(", "Class", "<", "?", ">", "nextInterface", ":", "mBeanClass", ".", "getInterfaces", "(", ")", ")", "{", "String", "nextInterfaceName", "=", "nextInterface", ".", "getName", "(", ")", ";", "// Skip any interface which is not published.", "if", "(", "!", "publishedInterfaceNames", ".", "contains", "(", "nextInterfaceName", ")", ")", "{", "// System.out.println(methodName + \": Candidate interface [ \" + nextInterfaceName + \" ]: Skip, not published\");", "continue", ";", "}", "// Immediate case: Match on the bean class name and ends with \"MBean\". ", "if", "(", "nextInterfaceName", ".", "equals", "(", "directInterfaceName", ")", ")", "{", "// System.out.println(methodName + \": RETURN [ \" + mBean + \" ] Direct match on interface [ \" + nextInterfaceName + \" ]\"); ", "return", "mBean", ";", "}", "// Immediate case: Match on interface tagged with \"@MXBean(true)\".", "// Immediate case: Match on an interface not tagged with \"@MXBean(false)\"", "// and which ends with \"MXBean\".", "MXBean", "mxbean", "=", "nextInterface", ".", "getAnnotation", "(", "MXBean", ".", "class", ")", ";", "if", "(", "mxbean", "!=", "null", ")", "{", "if", "(", "mxbean", ".", "value", "(", ")", ")", "{", "// System.out.println(methodName + \": RETURN [ \" + mBean + \" ] Direct match on @MXBean [ \" + nextInterfaceName + \" ]\"); ", "return", "mBean", ";", "}", "else", "{", "// System.out.println(methodName + \": Ignoring interface [ \" + nextInterfaceName + \" ] with @MXBean(false)\"); ", "// \"@MXBean(false)\"", "}", "}", "else", "{", "if", "(", "nextInterfaceName", ".", "endsWith", "(", "\"MXBean\"", ")", ")", "{", "// System.out.println(methodName + \": RETURN [ \" + mBean + \" ] Direct match on MXBean [ \" + nextInterfaceName + \" ]\");", "return", "mBean", ";", "}", "}", "// Secondary case: Not a match on bean class name but ending with", "// \"MBean\". Use as a fall back if the none of the immediate cases", "// triggers.", "if", "(", "nextInterfaceName", ".", "endsWith", "(", "\"MBean\"", ")", ")", "{", "// System.out.println(methodName + \": Partial match on interface [ \" + nextInterfaceName + \" ]\"); ", "fallbackInterface", "=", "nextInterface", ";", "// Do NOT return immediately.", "}", "}", "// REVISIT: The object wasn't of the form we were expecting though", "// might still be an MBean. For now let's reject it. We can support", "// more types of MBeans later.", "if", "(", "fallbackInterface", "==", "null", ")", "{", "// System.out.println(methodName + \": Failing with NonCompliantMBeanException\");", "StringBuilder", "errorMessage", "=", "new", "StringBuilder", "(", ")", ";", "errorMessage", ".", "append", "(", "\"Unregisterable MBean: [ \"", "+", "mBeanClass", ".", "getName", "(", ")", "+", "\" ]\"", ")", ";", "for", "(", "Class", "<", "?", ">", "nextInterface", ":", "mBeanClass", ".", "getInterfaces", "(", ")", ")", "{", "errorMessage", ".", "append", "(", "\" implements [ \"", "+", "nextInterface", ".", "getName", "(", ")", "+", "\" ]\"", ")", ";", "}", "for", "(", "String", "publishedName", ":", "(", "String", "[", "]", ")", "serviceReference", ".", "getProperty", "(", "Constants", ".", "OBJECTCLASS", ")", ")", "{", "errorMessage", ".", "append", "(", "\" published [ \"", "+", "publishedName", "+", "\" ]\"", ")", ";", "}", "throw", "new", "NotCompliantMBeanException", "(", "errorMessage", ".", "toString", "(", ")", ")", ";", "}", "Object", "standardMBean", ";", "if", "(", "mBean", "instanceof", "NotificationEmitter", ")", "{", "// System.out.println(methodName + \": RETURN [ \" + mBean + \" ] (Standard Emitter MBean)\");", "standardMBean", "=", "new", "StandardEmitterMBean", "(", "mBean", ",", "(", "Class", ")", "fallbackInterface", ",", "(", "NotificationEmitter", ")", "mBean", ")", ";", "}", "else", "{", "// System.out.println(methodName + \": RETURN [ \" + mBean + \" ] (Standard MBean)\"); ", "standardMBean", "=", "new", "StandardMBean", "(", "mBean", ",", "(", "Class", ")", "fallbackInterface", ")", ";", "}", "return", "standardMBean", ";", "}" ]
Register an object as a managed bean. Wrapper the object if necessary. Registration has several steps: A dynamic mbean ({@link DynamicMBean}) is returned immediately. A configuration mbean ({@link ConfigurationAdminMBean}) is wrapped as a read-only mbean ({@link ReadConfigurationAdmin}) and that is returned. Otherwise, the managed bean is tested against the published interfaces defined by the service. The service specified published interfaces using {@link Constants#OBJECTCLASS}. For each interface of the managed bean which is a published interface, these tests are performed: If the interface matches the managed bean class name plus "MBean", return the managed bean immediately. If the interface matches the managed bean class name plus "MXBean", and is not annotated with <code>@MXBean(false)</code>, return the managed bean immediately. If the the interface is annotated with <code>@MXBean(true)</code>, return the managed bean immediately. If the interface name ends with "MBean", select it as the managed bean type. However, keep checking for an immediate case, which would take precedence. After checking all interfaces, uses the last selected interface name which is not an immediate case, and create a standard managed bean wrapping the managed bean, either as {@link StandardMBean} or as {@link StandardEmiterMBean}. Finally, if no interface is selected, throw an exception. @param serviceReference The service reference providing the list of published interface names. @param mBean The managed bean. @return A registerable managed bean, either the managed bean itself, or a wrapper of the managed bean. @throws NotCompliantMBeanException It the managed bean is not registerable.
[ "Register", "an", "object", "as", "a", "managed", "bean", ".", "Wrapper", "the", "object", "if", "necessary", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx/src/com/ibm/ws/jmx/internal/MBeanUtil.java#L76-L178
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java
TimedDirContext.traceJndiBegin
private void traceJndiBegin(String methodname, Object... objs) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { String providerURL = "UNKNOWN"; try { providerURL = (String) getEnvironment().get(Context.PROVIDER_URL); } catch (NamingException ne) { /* Ignore. */ } Tr.debug(tc, JNDI_CALL + methodname + " [" + providerURL + "]", objs); } }
java
private void traceJndiBegin(String methodname, Object... objs) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { String providerURL = "UNKNOWN"; try { providerURL = (String) getEnvironment().get(Context.PROVIDER_URL); } catch (NamingException ne) { /* Ignore. */ } Tr.debug(tc, JNDI_CALL + methodname + " [" + providerURL + "]", objs); } }
[ "private", "void", "traceJndiBegin", "(", "String", "methodname", ",", "Object", "...", "objs", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "String", "providerURL", "=", "\"UNKNOWN\"", ";", "try", "{", "providerURL", "=", "(", "String", ")", "getEnvironment", "(", ")", ".", "get", "(", "Context", ".", "PROVIDER_URL", ")", ";", "}", "catch", "(", "NamingException", "ne", ")", "{", "/* Ignore. */", "}", "Tr", ".", "debug", "(", "tc", ",", "JNDI_CALL", "+", "methodname", "+", "\" [\"", "+", "providerURL", "+", "\"]\"", ",", "objs", ")", ";", "}", "}" ]
Trace a message with "JNDI_CALL' that includes the parameters sent to the JNDI call. @param methodname The name of the method that is requesting the trace. @param objs The parameters to trace.
[ "Trace", "a", "message", "with", "JNDI_CALL", "that", "includes", "the", "parameters", "sent", "to", "the", "JNDI", "call", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java#L510-L520
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java
TimedDirContext.traceJndiReturn
private void traceJndiReturn(String methodname, long duration, Object... objs) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms]", objs); } }
java
private void traceJndiReturn(String methodname, long duration, Object... objs) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms]", objs); } }
[ "private", "void", "traceJndiReturn", "(", "String", "methodname", ",", "long", "duration", ",", "Object", "...", "objs", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "JNDI_CALL", "+", "methodname", "+", "\" [\"", "+", "duration", "+", "\" ms]\"", ",", "objs", ")", ";", "}", "}" ]
Trace a message with "JNDI_CALL' that includes the returned objects from that JNDI call. @param methodname The name of the method that is requesting the trace. @param duration The duration of the call in milliseconds. @param objs The objects to trace.
[ "Trace", "a", "message", "with", "JNDI_CALL", "that", "includes", "the", "returned", "objects", "from", "that", "JNDI", "call", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java#L529-L533
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java
TimedDirContext.traceJndiThrow
private void traceJndiThrow(String methodname, long duration, NamingException ne) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms] " + ne.getMessage(), ne); } }
java
private void traceJndiThrow(String methodname, long duration, NamingException ne) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms] " + ne.getMessage(), ne); } }
[ "private", "void", "traceJndiThrow", "(", "String", "methodname", ",", "long", "duration", ",", "NamingException", "ne", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "JNDI_CALL", "+", "methodname", "+", "\" [\"", "+", "duration", "+", "\" ms] \"", "+", "ne", ".", "getMessage", "(", ")", ",", "ne", ")", ";", "}", "}" ]
Trace a message with "JNDI_CALL' that includes the resulting exception from that JNDI call. @param methodname The name of the method that is requesting the trace. @param duration The duration of the call in milliseconds. @param ne The {@link NamingException}.
[ "Trace", "a", "message", "with", "JNDI_CALL", "that", "includes", "the", "resulting", "exception", "from", "that", "JNDI", "call", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java#L542-L546
train
OpenLiberty/open-liberty
dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/render/Renderer.java
Renderer.encodeChildren
public void encodeChildren(FacesContext context, UIComponent component) throws IOException { if (context == null) { throw new NullPointerException("context"); } if (component == null) { throw new NullPointerException("component"); } if (component.getChildCount() > 0) { for (int i = 0, childCount = component.getChildCount(); i < childCount; i++) { UIComponent child = component.getChildren().get(i); if (!child.isRendered()) { continue; } child.encodeAll(context); } } }
java
public void encodeChildren(FacesContext context, UIComponent component) throws IOException { if (context == null) { throw new NullPointerException("context"); } if (component == null) { throw new NullPointerException("component"); } if (component.getChildCount() > 0) { for (int i = 0, childCount = component.getChildCount(); i < childCount; i++) { UIComponent child = component.getChildren().get(i); if (!child.isRendered()) { continue; } child.encodeAll(context); } } }
[ "public", "void", "encodeChildren", "(", "FacesContext", "context", ",", "UIComponent", "component", ")", "throws", "IOException", "{", "if", "(", "context", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"context\"", ")", ";", "}", "if", "(", "component", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"component\"", ")", ";", "}", "if", "(", "component", ".", "getChildCount", "(", ")", ">", "0", ")", "{", "for", "(", "int", "i", "=", "0", ",", "childCount", "=", "component", ".", "getChildCount", "(", ")", ";", "i", "<", "childCount", ";", "i", "++", ")", "{", "UIComponent", "child", "=", "component", ".", "getChildren", "(", ")", ".", "get", "(", "i", ")", ";", "if", "(", "!", "child", ".", "isRendered", "(", ")", ")", "{", "continue", ";", "}", "child", ".", "encodeAll", "(", "context", ")", ";", "}", "}", "}" ]
Render all children if there are any. Note: this will only be called if getRendersChildren() returns true. A component which has a renderer with getRendersChildren() set to true will typically contain the rendering logic for its children in this method. @param context @param component @throws IOException
[ "Render", "all", "children", "if", "there", "are", "any", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/render/Renderer.java#L74-L98
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchConsumer.java
AsynchConsumer.registerCallback
void registerCallback(AsynchConsumerCallback callback) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "registerCallback", callback); asynchConsumerCallback = callback; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "registerCallback"); }
java
void registerCallback(AsynchConsumerCallback callback) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "registerCallback", callback); asynchConsumerCallback = callback; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "registerCallback"); }
[ "void", "registerCallback", "(", "AsynchConsumerCallback", "callback", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"registerCallback\"", ",", "callback", ")", ";", "asynchConsumerCallback", "=", "callback", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"registerCallback\"", ")", ";", "}" ]
Register the AsynchConsumerCallback. If callback is null then this is the equivalent of deregister, i.e. callbackRegistered is set to false. @param callback
[ "Register", "the", "AsynchConsumerCallback", ".", "If", "callback", "is", "null", "then", "this", "is", "the", "equivalent", "of", "deregister", "i", ".", "e", ".", "callbackRegistered", "is", "set", "to", "false", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchConsumer.java#L50-L59
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchConsumer.java
AsynchConsumer.processMsgs
void processMsgs(LockedMessageEnumeration msgEnumeration, ConsumerSession consumerSession) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "processMsgs", new Object[] { msgEnumeration, consumerSession }); // Remember that a callback is running asynchConsumerRunning = true; try { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Entering asynchConsumerCallback.consumeMessages", new Object[] {asynchConsumerCallback, msgEnumeration}); //Call the consumeMessages method on the registered //AsynchConsumerCallback object asynchConsumerCallback.consumeMessages(msgEnumeration); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Exiting asynchConsumerCallback.consumeMessages"); } catch (Throwable e) { //Catch any exceptions thrown by consumeMessages. FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.AsynchConsumer.processMsgs", "1:124:1.37", this); //Notify the consumer that this exception occurred. if(consumerSession!=null) { try { //Notify the consumer that this exception occurred. notifyExceptionListeners(e, consumerSession); } catch(Exception connectionClosed) { //No FFDC code needed } } //Trace the exception but otherwise swallow it since it was not //a failure in MP code or code upon which the MP is critically //dependent. if (e instanceof Exception) SibTr.exception(tc, (Exception)e); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Exception occurred in consumeMessages " + e); // We're not allowed to swallow this exception - let it work its way back to // the threadpool if(e instanceof ThreadDeath) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "processMsgs", e); throw (ThreadDeath)e; } } finally { asynchConsumerRunning = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "processMsgs"); }
java
void processMsgs(LockedMessageEnumeration msgEnumeration, ConsumerSession consumerSession) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "processMsgs", new Object[] { msgEnumeration, consumerSession }); // Remember that a callback is running asynchConsumerRunning = true; try { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Entering asynchConsumerCallback.consumeMessages", new Object[] {asynchConsumerCallback, msgEnumeration}); //Call the consumeMessages method on the registered //AsynchConsumerCallback object asynchConsumerCallback.consumeMessages(msgEnumeration); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Exiting asynchConsumerCallback.consumeMessages"); } catch (Throwable e) { //Catch any exceptions thrown by consumeMessages. FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.AsynchConsumer.processMsgs", "1:124:1.37", this); //Notify the consumer that this exception occurred. if(consumerSession!=null) { try { //Notify the consumer that this exception occurred. notifyExceptionListeners(e, consumerSession); } catch(Exception connectionClosed) { //No FFDC code needed } } //Trace the exception but otherwise swallow it since it was not //a failure in MP code or code upon which the MP is critically //dependent. if (e instanceof Exception) SibTr.exception(tc, (Exception)e); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Exception occurred in consumeMessages " + e); // We're not allowed to swallow this exception - let it work its way back to // the threadpool if(e instanceof ThreadDeath) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "processMsgs", e); throw (ThreadDeath)e; } } finally { asynchConsumerRunning = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "processMsgs"); }
[ "void", "processMsgs", "(", "LockedMessageEnumeration", "msgEnumeration", ",", "ConsumerSession", "consumerSession", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"processMsgs\"", ",", "new", "Object", "[", "]", "{", "msgEnumeration", ",", "consumerSession", "}", ")", ";", "// Remember that a callback is running", "asynchConsumerRunning", "=", "true", ";", "try", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Entering asynchConsumerCallback.consumeMessages\"", ",", "new", "Object", "[", "]", "{", "asynchConsumerCallback", ",", "msgEnumeration", "}", ")", ";", "//Call the consumeMessages method on the registered", "//AsynchConsumerCallback object", "asynchConsumerCallback", ".", "consumeMessages", "(", "msgEnumeration", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Exiting asynchConsumerCallback.consumeMessages\"", ")", ";", "}", "catch", "(", "Throwable", "e", ")", "{", "//Catch any exceptions thrown by consumeMessages.", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.AsynchConsumer.processMsgs\"", ",", "\"1:124:1.37\"", ",", "this", ")", ";", "//Notify the consumer that this exception occurred.", "if", "(", "consumerSession", "!=", "null", ")", "{", "try", "{", "//Notify the consumer that this exception occurred.", "notifyExceptionListeners", "(", "e", ",", "consumerSession", ")", ";", "}", "catch", "(", "Exception", "connectionClosed", ")", "{", "//No FFDC code needed", "}", "}", "//Trace the exception but otherwise swallow it since it was not", "//a failure in MP code or code upon which the MP is critically", "//dependent.", "if", "(", "e", "instanceof", "Exception", ")", "SibTr", ".", "exception", "(", "tc", ",", "(", "Exception", ")", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Exception occurred in consumeMessages \"", "+", "e", ")", ";", "// We're not allowed to swallow this exception - let it work its way back to", "// the threadpool", "if", "(", "e", "instanceof", "ThreadDeath", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"processMsgs\"", ",", "e", ")", ";", "throw", "(", "ThreadDeath", ")", "e", ";", "}", "}", "finally", "{", "asynchConsumerRunning", "=", "false", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"processMsgs\"", ")", ";", "}" ]
Calls the registered AsynchConsumerCallback with the given message enumeration. @param msgEnumeration An enumeration of the locked messages for this AsynchConsumerCallback.
[ "Calls", "the", "registered", "AsynchConsumerCallback", "with", "the", "given", "message", "enumeration", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchConsumer.java#L68-L139
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchConsumer.java
AsynchConsumer.isAsynchConsumerRunning
boolean isAsynchConsumerRunning() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "isAsynchConsumerRunning"); SibTr.exit(tc, "isAsynchConsumerRunning", new Boolean(asynchConsumerRunning)); } return asynchConsumerRunning; }
java
boolean isAsynchConsumerRunning() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "isAsynchConsumerRunning"); SibTr.exit(tc, "isAsynchConsumerRunning", new Boolean(asynchConsumerRunning)); } return asynchConsumerRunning; }
[ "boolean", "isAsynchConsumerRunning", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "tc", ",", "\"isAsynchConsumerRunning\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"isAsynchConsumerRunning\"", ",", "new", "Boolean", "(", "asynchConsumerRunning", ")", ")", ";", "}", "return", "asynchConsumerRunning", ";", "}" ]
Is the callback currently running? @return asynchConsumerRunning
[ "Is", "the", "callback", "currently", "running?" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchConsumer.java#L145-L156
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java
CATBrowseConsumer.sendMessage
private long sendMessage(SIBusMessage msg) throws OperationFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "sendMessage", msg); long retValue = 0; // If we are at FAP9 or above we can do a 'chunked' send of the message in seperate // slices to make life easier on the Java memory manager final HandshakeProperties props = getConversation().getHandshakeProperties(); if (props.getFapLevel() >= JFapChannelConstants.FAP_VERSION_9) { retValue = sendChunkedMessage(msg); } else { retValue = sendEntireMessage(msg, null); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "sendMessage", "" + retValue); return retValue; }
java
private long sendMessage(SIBusMessage msg) throws OperationFailedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "sendMessage", msg); long retValue = 0; // If we are at FAP9 or above we can do a 'chunked' send of the message in seperate // slices to make life easier on the Java memory manager final HandshakeProperties props = getConversation().getHandshakeProperties(); if (props.getFapLevel() >= JFapChannelConstants.FAP_VERSION_9) { retValue = sendChunkedMessage(msg); } else { retValue = sendEntireMessage(msg, null); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "sendMessage", "" + retValue); return retValue; }
[ "private", "long", "sendMessage", "(", "SIBusMessage", "msg", ")", "throws", "OperationFailedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"sendMessage\"", ",", "msg", ")", ";", "long", "retValue", "=", "0", ";", "// If we are at FAP9 or above we can do a 'chunked' send of the message in seperate", "// slices to make life easier on the Java memory manager", "final", "HandshakeProperties", "props", "=", "getConversation", "(", ")", ".", "getHandshakeProperties", "(", ")", ";", "if", "(", "props", ".", "getFapLevel", "(", ")", ">=", "JFapChannelConstants", ".", "FAP_VERSION_9", ")", "{", "retValue", "=", "sendChunkedMessage", "(", "msg", ")", ";", "}", "else", "{", "retValue", "=", "sendEntireMessage", "(", "msg", ",", "null", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"sendMessage\"", ",", "\"\"", "+", "retValue", ")", ";", "return", "retValue", ";", "}" ]
Helper function. Sends an SIBusMessage to the client, taking care of the myriad pesky exceptions which may get thrown. If something does go wrong then the caller is notified by a single OperationFailedException. By this point the appropriate error flow has also been transmitted to the client. @param msg The message to send. @return long The size of the data sent. @throws OperationFailedException Thrown if something goes wrong. Before this is thrown the appropriate clean up and notification of the client will have occurred. It is intended that this exception is used to notify the caller to abort whatever it was doing.
[ "Helper", "function", ".", "Sends", "an", "SIBusMessage", "to", "the", "client", "taking", "care", "of", "the", "myriad", "pesky", "exceptions", "which", "may", "get", "thrown", ".", "If", "something", "does", "go", "wrong", "then", "the", "caller", "is", "notified", "by", "a", "single", "OperationFailedException", ".", "By", "this", "point", "the", "appropriate", "error", "flow", "has", "also", "been", "transmitted", "to", "the", "client", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java#L101-L119
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java
CATBrowseConsumer.reset
@Override public void reset() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIResourceException, SIConnectionLostException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "reset"); BrowserSession browserSession = mainConsumer.getBrowserSession(); ++msgBatch; browserSession.reset(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "reset"); }
java
@Override public void reset() throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIResourceException, SIConnectionLostException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "reset"); BrowserSession browserSession = mainConsumer.getBrowserSession(); ++msgBatch; browserSession.reset(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "reset"); }
[ "@", "Override", "public", "void", "reset", "(", ")", "throws", "SISessionUnavailableException", ",", "SISessionDroppedException", ",", "SIConnectionUnavailableException", ",", "SIConnectionDroppedException", ",", "SIResourceException", ",", "SIConnectionLostException", ",", "SIErrorException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"reset\"", ")", ";", "BrowserSession", "browserSession", "=", "mainConsumer", ".", "getBrowserSession", "(", ")", ";", "++", "msgBatch", ";", "browserSession", ".", "reset", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"reset\"", ")", ";", "}" ]
Called in response to a client requesting we reset the browse cursor for a particular broser session. @throws SISessionUnavailableException @throws SISessionDroppedException @throws SIConnectionUnavailableException @throws SIConnectionDroppedException @throws SIResourceException @throws SIConnectionLostException @throws SIErrorException
[ "Called", "in", "response", "to", "a", "client", "requesting", "we", "reset", "the", "browse", "cursor", "for", "a", "particular", "broser", "session", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java#L454-L469
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java
CATBrowseConsumer.flush
@Override public void flush(int requestNumber) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "flush", "" + requestNumber); // Locate the browser session to use. BrowserSession browserSession = mainConsumer.getBrowserSession(); SIBusMessage msg = null; // Browse the next message and send it to the client. try { msg = getNextMessage(browserSession, getConversation(), (short) requestNumber); if (msg != null) sendMessage(msg); // Send a response to the browse request. try { getConversation().send(poolManager.allocate(), JFapChannelConstants.SEG_FLUSH_SESS_R, requestNumber, Conversation.PRIORITY_LOWEST, true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".flush", CommsConstants.CATBROWSECONSUMER_FLUSH_01, this); SibTr.error(tc, "COMMUNICATION_ERROR_SICO2012", e); // Nothing else we can do at this point as the comms exception suggests that the // conversation is dead, anyway. } } catch (OperationFailedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "flush"); }
java
@Override public void flush(int requestNumber) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "flush", "" + requestNumber); // Locate the browser session to use. BrowserSession browserSession = mainConsumer.getBrowserSession(); SIBusMessage msg = null; // Browse the next message and send it to the client. try { msg = getNextMessage(browserSession, getConversation(), (short) requestNumber); if (msg != null) sendMessage(msg); // Send a response to the browse request. try { getConversation().send(poolManager.allocate(), JFapChannelConstants.SEG_FLUSH_SESS_R, requestNumber, Conversation.PRIORITY_LOWEST, true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".flush", CommsConstants.CATBROWSECONSUMER_FLUSH_01, this); SibTr.error(tc, "COMMUNICATION_ERROR_SICO2012", e); // Nothing else we can do at this point as the comms exception suggests that the // conversation is dead, anyway. } } catch (OperationFailedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "flush"); }
[ "@", "Override", "public", "void", "flush", "(", "int", "requestNumber", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"flush\"", ",", "\"\"", "+", "requestNumber", ")", ";", "// Locate the browser session to use.", "BrowserSession", "browserSession", "=", "mainConsumer", ".", "getBrowserSession", "(", ")", ";", "SIBusMessage", "msg", "=", "null", ";", "// Browse the next message and send it to the client.", "try", "{", "msg", "=", "getNextMessage", "(", "browserSession", ",", "getConversation", "(", ")", ",", "(", "short", ")", "requestNumber", ")", ";", "if", "(", "msg", "!=", "null", ")", "sendMessage", "(", "msg", ")", ";", "// Send a response to the browse request.", "try", "{", "getConversation", "(", ")", ".", "send", "(", "poolManager", ".", "allocate", "(", ")", ",", "JFapChannelConstants", ".", "SEG_FLUSH_SESS_R", ",", "requestNumber", ",", "Conversation", ".", "PRIORITY_LOWEST", ",", "true", ",", "ThrottlingPolicy", ".", "BLOCK_THREAD", ",", "null", ")", ";", "}", "catch", "(", "SIException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "CLASS_NAME", "+", "\".flush\"", ",", "CommsConstants", ".", "CATBROWSECONSUMER_FLUSH_01", ",", "this", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"COMMUNICATION_ERROR_SICO2012\"", ",", "e", ")", ";", "// Nothing else we can do at this point as the comms exception suggests that the", "// conversation is dead, anyway.", "}", "}", "catch", "(", "OperationFailedException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "exception", "(", "this", ",", "tc", ",", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"flush\"", ")", ";", "}" ]
Invoked when the client sends a flush consumer. Since browser sessions do not have an activeConsumer method this translates to attempting a single browse next and sending back the result. @param requestNumber
[ "Invoked", "when", "the", "client", "sends", "a", "flush", "consumer", ".", "Since", "browser", "sessions", "do", "not", "have", "an", "activeConsumer", "method", "this", "translates", "to", "attempting", "a", "single", "browse", "next", "and", "sending", "back", "the", "result", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java#L478-L521
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java
CATBrowseConsumer.close
@Override public void close(int requestNumber) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close", "" + requestNumber); BrowserSession browserSession = mainConsumer.getBrowserSession(); try { browserSession.close(); } catch (SIException e) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event. if (!((ConversationState) getConversation().getAttachment()).hasMETerminated()) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATBROWSECONSUMER_CLOSE_01, this); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, e.getMessage(), e); StaticCATHelper.sendExceptionToClient(e, CommsConstants.CATBROWSECONSUMER_CLOSE_01, getConversation(), requestNumber); } try { getConversation().send(poolManager.allocate(), JFapChannelConstants.SEG_CLOSE_CONSUMER_SESS_R, requestNumber, Conversation.PRIORITY_LOWEST, true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATBROWSECONSUMER_CLOSE_02, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, e.getMessage(), e); // d175222 // Cannot do anything else at this point as a comms exception suggests that the // connection is unusable. } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close"); }
java
@Override public void close(int requestNumber) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close", "" + requestNumber); BrowserSession browserSession = mainConsumer.getBrowserSession(); try { browserSession.close(); } catch (SIException e) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event. if (!((ConversationState) getConversation().getAttachment()).hasMETerminated()) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATBROWSECONSUMER_CLOSE_01, this); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, e.getMessage(), e); StaticCATHelper.sendExceptionToClient(e, CommsConstants.CATBROWSECONSUMER_CLOSE_01, getConversation(), requestNumber); } try { getConversation().send(poolManager.allocate(), JFapChannelConstants.SEG_CLOSE_CONSUMER_SESS_R, requestNumber, Conversation.PRIORITY_LOWEST, true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATBROWSECONSUMER_CLOSE_02, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, e.getMessage(), e); // d175222 // Cannot do anything else at this point as a comms exception suggests that the // connection is unusable. } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close"); }
[ "@", "Override", "public", "void", "close", "(", "int", "requestNumber", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"close\"", ",", "\"\"", "+", "requestNumber", ")", ";", "BrowserSession", "browserSession", "=", "mainConsumer", ".", "getBrowserSession", "(", ")", ";", "try", "{", "browserSession", ".", "close", "(", ")", ";", "}", "catch", "(", "SIException", "e", ")", "{", "//No FFDC code needed", "//Only FFDC if we haven't received a meTerminated event.", "if", "(", "!", "(", "(", "ConversationState", ")", "getConversation", "(", ")", ".", "getAttachment", "(", ")", ")", ".", "hasMETerminated", "(", ")", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "CLASS_NAME", "+", "\".close\"", ",", "CommsConstants", ".", "CATBROWSECONSUMER_CLOSE_01", ",", "this", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "StaticCATHelper", ".", "sendExceptionToClient", "(", "e", ",", "CommsConstants", ".", "CATBROWSECONSUMER_CLOSE_01", ",", "getConversation", "(", ")", ",", "requestNumber", ")", ";", "}", "try", "{", "getConversation", "(", ")", ".", "send", "(", "poolManager", ".", "allocate", "(", ")", ",", "JFapChannelConstants", ".", "SEG_CLOSE_CONSUMER_SESS_R", ",", "requestNumber", ",", "Conversation", ".", "PRIORITY_LOWEST", ",", "true", ",", "ThrottlingPolicy", ".", "BLOCK_THREAD", ",", "null", ")", ";", "}", "catch", "(", "SIException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "CLASS_NAME", "+", "\".close\"", ",", "CommsConstants", ".", "CATBROWSECONSUMER_CLOSE_02", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "// d175222", "// Cannot do anything else at this point as a comms exception suggests that the", "// connection is unusable.", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"close\"", ")", ";", "}" ]
Closes the browser. @param requestNumber
[ "Closes", "the", "browser", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATBrowseConsumer.java#L528-L575
train