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.logging.core/src/com/ibm/websphere/ras/Tr.java
Tr.register
public static TraceComponent register(String name, Class<?> aClass, String[] groups) { return register(name, aClass, groups, null); }
java
public static TraceComponent register(String name, Class<?> aClass, String[] groups) { return register(name, aClass, groups, null); }
[ "public", "static", "TraceComponent", "register", "(", "String", "name", ",", "Class", "<", "?", ">", "aClass", ",", "String", "[", "]", "groups", ")", "{", "return", "register", "(", "name", ",", "aClass", ",", "groups", ",", "null", ")", ";", "}" ]
Register the provided name with the trace service and assign it to the provided groups. @param name a <code>String</code> to register a component for with the trace manager. The name is used in the registration process. @param aClass a valid <code>Class</code> to register a component for with the trace manager. The class is used for location of resource bundles. @param groups a list of the groups that the named component is a member of. Null is allowed. If null is passed, the name is not added to a group. Once added to a group, there is no corresponding mechanism to remove a component from a group. @return TraceComponent the <code>TraceComponent</code> corresponding to the name of the specified name.
[ "Register", "the", "provided", "name", "with", "the", "trace", "service", "and", "assign", "it", "to", "the", "provided", "groups", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L228-L230
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java
Tr.audit
public static final void audit(TraceComponent tc, String msgKey, Object... objs) { TrConfigurator.getDelegate().audit(tc, msgKey, objs); }
java
public static final void audit(TraceComponent tc, String msgKey, Object... objs) { TrConfigurator.getDelegate().audit(tc, msgKey, objs); }
[ "public", "static", "final", "void", "audit", "(", "TraceComponent", "tc", ",", "String", "msgKey", ",", "Object", "...", "objs", ")", "{", "TrConfigurator", ".", "getDelegate", "(", ")", ".", "audit", "(", "tc", ",", "msgKey", ",", "objs", ")", ";", "}" ]
Print the provided translated message if the input trace component allows audit level messages. @param tc the non-null <code>TraceComponent</code> the event is associated with. @param msgKey the message key identifying an NLS message for this event. This message must be in the resource bundle currently associated with the <code>TraceComponent</code>. @param objs a number of <code>Objects</code> to include as substitution text in the message. The number of objects passed must equal the number of substitution parameters the message expects. Null is tolerated.
[ "Print", "the", "provided", "translated", "message", "if", "the", "input", "trace", "component", "allows", "audit", "level", "messages", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L364-L366
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java
Tr.entry
public static final void entry(TraceComponent tc, String methodName, Object... objs) { TrConfigurator.getDelegate().entry(tc, methodName, objs); }
java
public static final void entry(TraceComponent tc, String methodName, Object... objs) { TrConfigurator.getDelegate().entry(tc, methodName, objs); }
[ "public", "static", "final", "void", "entry", "(", "TraceComponent", "tc", ",", "String", "methodName", ",", "Object", "...", "objs", ")", "{", "TrConfigurator", ".", "getDelegate", "(", ")", ".", "entry", "(", "tc", ",", "methodName", ",", "objs", ")", ";", "}" ]
Print the provided trace point if the input trace component allows entry level messages. @param tc the non-null <code>TraceComponent</code> the event is associated with. @param methodName @param objs a variable number (zero to n) of <code>Objects</code>. toString() is called on each object and the results are appended to the message.
[ "Print", "the", "provided", "trace", "point", "if", "the", "input", "trace", "component", "allows", "entry", "level", "messages", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L442-L444
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java
Tr.formatMessage
public static final String formatMessage(TraceComponent tc, String msgKey, Object... objs) { return formatMessage(tc, Locale.getDefault(), msgKey, objs); }
java
public static final String formatMessage(TraceComponent tc, String msgKey, Object... objs) { return formatMessage(tc, Locale.getDefault(), msgKey, objs); }
[ "public", "static", "final", "String", "formatMessage", "(", "TraceComponent", "tc", ",", "String", "msgKey", ",", "Object", "...", "objs", ")", "{", "return", "formatMessage", "(", "tc", ",", "Locale", ".", "getDefault", "(", ")", ",", "msgKey", ",", "objs", ")", ";", "}" ]
Translate a message in the context of the input trace component using the default locale. This method is typically used to provide translated messages that might help resolve an exception that is surfaced to a user. @param tc the non-null <code>TraceComponent</code> of the message @param msgKey the message key identifying an NLS message for this event. This message must be in the resource bundle currently associated with the <code>TraceComponent</code>. @param objs a number of <code>Objects</code> to include as substitution text in the message. The number of objects passed must equal the number of substitution parameters the message expects. Null is tolerated. @return the translated message
[ "Translate", "a", "message", "in", "the", "context", "of", "the", "input", "trace", "component", "using", "the", "default", "locale", ".", "This", "method", "is", "typically", "used", "to", "provide", "translated", "messages", "that", "might", "help", "resolve", "an", "exception", "that", "is", "surfaced", "to", "a", "user", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L675-L677
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java
Tr.formatMessage
public static final String formatMessage(TraceComponent tc, List<Locale> locales, String msgKey, Object... objs) { // WsLogRecord.createWsLogRecord + BaseTraceService.formatMessage // The best odds for finding the resource bundle are with using the // classloader that loaded the associated class to begin with. Start // there. ResourceBundle rb; String msg; try { rb = TraceNLSResolver.getInstance().getResourceBundle(tc.getTraceClass(), tc.getResourceBundleName(), locales); msg = rb.getString(msgKey); } catch (Exception ex) { // no FFDC required msg = msgKey; } if (msg.contains("{0")) { return MessageFormat.format(msg, objs); } return msg; }
java
public static final String formatMessage(TraceComponent tc, List<Locale> locales, String msgKey, Object... objs) { // WsLogRecord.createWsLogRecord + BaseTraceService.formatMessage // The best odds for finding the resource bundle are with using the // classloader that loaded the associated class to begin with. Start // there. ResourceBundle rb; String msg; try { rb = TraceNLSResolver.getInstance().getResourceBundle(tc.getTraceClass(), tc.getResourceBundleName(), locales); msg = rb.getString(msgKey); } catch (Exception ex) { // no FFDC required msg = msgKey; } if (msg.contains("{0")) { return MessageFormat.format(msg, objs); } return msg; }
[ "public", "static", "final", "String", "formatMessage", "(", "TraceComponent", "tc", ",", "List", "<", "Locale", ">", "locales", ",", "String", "msgKey", ",", "Object", "...", "objs", ")", "{", "// WsLogRecord.createWsLogRecord + BaseTraceService.formatMessage", "// The best odds for finding the resource bundle are with using the", "// classloader that loaded the associated class to begin with. Start", "// there.", "ResourceBundle", "rb", ";", "String", "msg", ";", "try", "{", "rb", "=", "TraceNLSResolver", ".", "getInstance", "(", ")", ".", "getResourceBundle", "(", "tc", ".", "getTraceClass", "(", ")", ",", "tc", ".", "getResourceBundleName", "(", ")", ",", "locales", ")", ";", "msg", "=", "rb", ".", "getString", "(", "msgKey", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "// no FFDC required", "msg", "=", "msgKey", ";", "}", "if", "(", "msg", ".", "contains", "(", "\"{0\"", ")", ")", "{", "return", "MessageFormat", ".", "format", "(", "msg", ",", "objs", ")", ";", "}", "return", "msg", ";", "}" ]
Translate a message in the context of the input trace component. This method is typically used to provide translated messages that might help resolve an exception that is surfaced to a user. @param tc the non-null <code>TraceComponent</code> of the message @param locales the possible locales to use for translation. Locales from the front of the list are preferred over Locales from the back of the list. If the list is null or empty, the default Locale will be used. @param msgKey the message key identifying an NLS message for this event. This message must be in the resource bundle currently associated with the <code>TraceComponent</code>. @param objs a number of <code>Objects</code> to include as substitution text in the message. The number of objects passed must equal the number of substitution parameters the message expects. Null is tolerated. @return the translated message
[ "Translate", "a", "message", "in", "the", "context", "of", "the", "input", "trace", "component", ".", "This", "method", "is", "typically", "used", "to", "provide", "translated", "messages", "that", "might", "help", "resolve", "an", "exception", "that", "is", "surfaced", "to", "a", "user", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L723-L744
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java
Tr.registerTraceComponent
static void registerTraceComponent(TraceComponent tc) { tc.setTraceSpec(activeTraceSpec); TrService activeDelegate = TrConfigurator.getDelegate(); activeDelegate.register(tc); TrConfigurator.traceComponentRegistered(tc); // Add the new TraceComponent to the queue of new trace components newTracecomponents.add(tc); processNewTraceComponents(); // There is a tiny window where the new trace component never gets processed, // however that isn't a problem as we only care that the set is correct is at the // beginning of our setTraceSpec method and it does process the list first }
java
static void registerTraceComponent(TraceComponent tc) { tc.setTraceSpec(activeTraceSpec); TrService activeDelegate = TrConfigurator.getDelegate(); activeDelegate.register(tc); TrConfigurator.traceComponentRegistered(tc); // Add the new TraceComponent to the queue of new trace components newTracecomponents.add(tc); processNewTraceComponents(); // There is a tiny window where the new trace component never gets processed, // however that isn't a problem as we only care that the set is correct is at the // beginning of our setTraceSpec method and it does process the list first }
[ "static", "void", "registerTraceComponent", "(", "TraceComponent", "tc", ")", "{", "tc", ".", "setTraceSpec", "(", "activeTraceSpec", ")", ";", "TrService", "activeDelegate", "=", "TrConfigurator", ".", "getDelegate", "(", ")", ";", "activeDelegate", ".", "register", "(", "tc", ")", ";", "TrConfigurator", ".", "traceComponentRegistered", "(", "tc", ")", ";", "// Add the new TraceComponent to the queue of new trace components", "newTracecomponents", ".", "add", "(", "tc", ")", ";", "processNewTraceComponents", "(", ")", ";", "// There is a tiny window where the new trace component never gets processed,", "// however that isn't a problem as we only care that the set is correct is at the", "// beginning of our setTraceSpec method and it does process the list first", "}" ]
Support for com.ibm.ejs.ras.Tr register methods
[ "Support", "for", "com", ".", "ibm", ".", "ejs", ".", "ras", ".", "Tr", "register", "methods" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L749-L763
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/BatchingContextImpl.java
BatchingContextImpl.updateXIDToCommitted
public void updateXIDToCommitted(PersistentTranId xid) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateXIDToCommitted", "XID="+xid); if (_deferredException == null) { // We are committing a transaction. The transaction can // be either one-phase or two-phase so we need to check // our state and then update it so that commit is called // at executeBatch() time. if (_state == STATE_ACTIVE || _state == STATE_PREPARED) { _state = STATE_COMMITTING; } else { _deferredException = new PersistenceException("Cannot COMMIT batch as it not in the correct state! State="+_stateToString[_state]); } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "No work attempted as an exception has already been thrown during this batch!"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateXIDToCommitted"); }
java
public void updateXIDToCommitted(PersistentTranId xid) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateXIDToCommitted", "XID="+xid); if (_deferredException == null) { // We are committing a transaction. The transaction can // be either one-phase or two-phase so we need to check // our state and then update it so that commit is called // at executeBatch() time. if (_state == STATE_ACTIVE || _state == STATE_PREPARED) { _state = STATE_COMMITTING; } else { _deferredException = new PersistenceException("Cannot COMMIT batch as it not in the correct state! State="+_stateToString[_state]); } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "No work attempted as an exception has already been thrown during this batch!"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateXIDToCommitted"); }
[ "public", "void", "updateXIDToCommitted", "(", "PersistentTranId", "xid", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"updateXIDToCommitted\"", ",", "\"XID=\"", "+", "xid", ")", ";", "if", "(", "_deferredException", "==", "null", ")", "{", "// We are committing a transaction. The transaction can", "// be either one-phase or two-phase so we need to check ", "// our state and then update it so that commit is called ", "// at executeBatch() time.", "if", "(", "_state", "==", "STATE_ACTIVE", "||", "_state", "==", "STATE_PREPARED", ")", "{", "_state", "=", "STATE_COMMITTING", ";", "}", "else", "{", "_deferredException", "=", "new", "PersistenceException", "(", "\"Cannot COMMIT batch as it not in the correct state! State=\"", "+", "_stateToString", "[", "_state", "]", ")", ";", "}", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"No work attempted as an exception has already been thrown during this batch!\"", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"updateXIDToCommitted\"", ")", ";", "}" ]
In the OM implementation this method is used to flag the batching context so that upon the next call to executeBatch the OM transaction being used is committed. @param xid
[ "In", "the", "OM", "implementation", "this", "method", "is", "used", "to", "flag", "the", "batching", "context", "so", "that", "upon", "the", "next", "call", "to", "executeBatch", "the", "OM", "transaction", "being", "used", "is", "committed", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/BatchingContextImpl.java#L607-L632
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMFactory.java
JPAEMFactory.unwrap
public <T> T unwrap(Class<T> cls) // d706751 { if (cls.isInstance(ivFactory)) { return cls.cast(ivFactory); } throw new PersistenceException(cls.toString()); }
java
public <T> T unwrap(Class<T> cls) // d706751 { if (cls.isInstance(ivFactory)) { return cls.cast(ivFactory); } throw new PersistenceException(cls.toString()); }
[ "public", "<", "T", ">", "T", "unwrap", "(", "Class", "<", "T", ">", "cls", ")", "// d706751", "{", "if", "(", "cls", ".", "isInstance", "(", "ivFactory", ")", ")", "{", "return", "cls", ".", "cast", "(", "ivFactory", ")", ";", "}", "throw", "new", "PersistenceException", "(", "cls", ".", "toString", "(", ")", ")", ";", "}" ]
Return an object of the specified type to allow access to provider-specific API. @param cls the class of the object to be returned @return an instance of the specified class @throws PersistenceException if the class is not supported
[ "Return", "an", "object", "of", "the", "specified", "type", "to", "allow", "access", "to", "provider", "-", "specific", "API", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMFactory.java#L78-L86
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/AtomicServiceReference.java
AtomicServiceReference.getService
@SuppressWarnings("unchecked") private T getService(boolean throwException) { T svc = null; ReferenceTuple<T> current = null; ReferenceTuple<T> newTuple = null; do { // Get the current tuple current = tuple.get(); // We have both a context and a service reference.. svc = current.locatedService; if (svc != null) { break; // break out. We know the answer, yes } // If we're missing the required bits, bail... if (current.context == null || current.serviceRef == null) { if (throwException) throw new IllegalStateException("Required attribute is null," + toString()); break; // break out. Nothing more to do here } // We have to locate / resolve the service from the reference SecurityManager sm = System.getSecurityManager(); if (sm != null) { final ReferenceTuple<T> finalCurrent = current; svc = AccessController.doPrivileged(new PrivilegedAction<T>() { @Override public T run() { return finalCurrent.context.locateService(referenceName, finalCurrent.serviceRef); } }); } else { svc = current.context.locateService(referenceName, current.serviceRef); } // if we're asked to throw, throw if we couldn't find the service if (svc == null) { if (throwException) throw new IllegalStateException("Located service is null," + toString()); break; // break out. Nothing more to do here } // Create a new tuple: keep the context and reference, set the cached service newTuple = new ReferenceTuple<T>(current.context, current.serviceRef, svc); // Try to save the new tuple: retry if someone changed the value meanwhile } while (!tuple.compareAndSet(current, newTuple)); return svc; }
java
@SuppressWarnings("unchecked") private T getService(boolean throwException) { T svc = null; ReferenceTuple<T> current = null; ReferenceTuple<T> newTuple = null; do { // Get the current tuple current = tuple.get(); // We have both a context and a service reference.. svc = current.locatedService; if (svc != null) { break; // break out. We know the answer, yes } // If we're missing the required bits, bail... if (current.context == null || current.serviceRef == null) { if (throwException) throw new IllegalStateException("Required attribute is null," + toString()); break; // break out. Nothing more to do here } // We have to locate / resolve the service from the reference SecurityManager sm = System.getSecurityManager(); if (sm != null) { final ReferenceTuple<T> finalCurrent = current; svc = AccessController.doPrivileged(new PrivilegedAction<T>() { @Override public T run() { return finalCurrent.context.locateService(referenceName, finalCurrent.serviceRef); } }); } else { svc = current.context.locateService(referenceName, current.serviceRef); } // if we're asked to throw, throw if we couldn't find the service if (svc == null) { if (throwException) throw new IllegalStateException("Located service is null," + toString()); break; // break out. Nothing more to do here } // Create a new tuple: keep the context and reference, set the cached service newTuple = new ReferenceTuple<T>(current.context, current.serviceRef, svc); // Try to save the new tuple: retry if someone changed the value meanwhile } while (!tuple.compareAndSet(current, newTuple)); return svc; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "T", "getService", "(", "boolean", "throwException", ")", "{", "T", "svc", "=", "null", ";", "ReferenceTuple", "<", "T", ">", "current", "=", "null", ";", "ReferenceTuple", "<", "T", ">", "newTuple", "=", "null", ";", "do", "{", "// Get the current tuple", "current", "=", "tuple", ".", "get", "(", ")", ";", "// We have both a context and a service reference.. ", "svc", "=", "current", ".", "locatedService", ";", "if", "(", "svc", "!=", "null", ")", "{", "break", ";", "// break out. We know the answer, yes", "}", "// If we're missing the required bits, bail... ", "if", "(", "current", ".", "context", "==", "null", "||", "current", ".", "serviceRef", "==", "null", ")", "{", "if", "(", "throwException", ")", "throw", "new", "IllegalStateException", "(", "\"Required attribute is null,\"", "+", "toString", "(", ")", ")", ";", "break", ";", "// break out. Nothing more to do here", "}", "// We have to locate / resolve the service from the reference ", "SecurityManager", "sm", "=", "System", ".", "getSecurityManager", "(", ")", ";", "if", "(", "sm", "!=", "null", ")", "{", "final", "ReferenceTuple", "<", "T", ">", "finalCurrent", "=", "current", ";", "svc", "=", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "T", ">", "(", ")", "{", "@", "Override", "public", "T", "run", "(", ")", "{", "return", "finalCurrent", ".", "context", ".", "locateService", "(", "referenceName", ",", "finalCurrent", ".", "serviceRef", ")", ";", "}", "}", ")", ";", "}", "else", "{", "svc", "=", "current", ".", "context", ".", "locateService", "(", "referenceName", ",", "current", ".", "serviceRef", ")", ";", "}", "// if we're asked to throw, throw if we couldn't find the service", "if", "(", "svc", "==", "null", ")", "{", "if", "(", "throwException", ")", "throw", "new", "IllegalStateException", "(", "\"Located service is null,\"", "+", "toString", "(", ")", ")", ";", "break", ";", "// break out. Nothing more to do here", "}", "// Create a new tuple: keep the context and reference, set the cached service ", "newTuple", "=", "new", "ReferenceTuple", "<", "T", ">", "(", "current", ".", "context", ",", "current", ".", "serviceRef", ",", "svc", ")", ";", "// Try to save the new tuple: retry if someone changed the value meanwhile", "}", "while", "(", "!", "tuple", ".", "compareAndSet", "(", "current", ",", "newTuple", ")", ")", ";", "return", "svc", ";", "}" ]
Try to locate the service @param throwException if true, throw exception when required services are missing @return T or null if unavailable
[ "Try", "to", "locate", "the", "service" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/AtomicServiceReference.java#L220-L273
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java
EJBThreadData.getCurrentThreadContext
private static <T> ThreadContext<T> getCurrentThreadContext(ThreadContext<T> threadContext) { return ((ThreadContextImpl<T>) threadContext).get(); }
java
private static <T> ThreadContext<T> getCurrentThreadContext(ThreadContext<T> threadContext) { return ((ThreadContextImpl<T>) threadContext).get(); }
[ "private", "static", "<", "T", ">", "ThreadContext", "<", "T", ">", "getCurrentThreadContext", "(", "ThreadContext", "<", "T", ">", "threadContext", ")", "{", "return", "(", "(", "ThreadContextImpl", "<", "T", ">", ")", "threadContext", ")", ".", "get", "(", ")", ";", "}" ]
Obtains a context object optimized for accessing the current thread.
[ "Obtains", "a", "context", "object", "optimized", "for", "accessing", "the", "current", "thread", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java#L47-L50
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java
EJBThreadData.getCallbackBeanO
public BeanO getCallbackBeanO() { BeanO result = ivCallbackBeanOStack.peek(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getCallbackBeanO: " + result); return result; }
java
public BeanO getCallbackBeanO() { BeanO result = ivCallbackBeanOStack.peek(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getCallbackBeanO: " + result); return result; }
[ "public", "BeanO", "getCallbackBeanO", "(", ")", "{", "BeanO", "result", "=", "ivCallbackBeanOStack", ".", "peek", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getCallbackBeanO: \"", "+", "result", ")", ";", "return", "result", ";", "}" ]
Gets a reference to the bean that the container is currently processing via a business method or lifecycle callback. @return the callback bean, or null if the container is not processing a bean
[ "Gets", "a", "reference", "to", "the", "bean", "that", "the", "container", "is", "currently", "processing", "via", "a", "business", "method", "or", "lifecycle", "callback", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java#L206-L213
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java
EJBThreadData.pushCallbackBeanO
public void pushCallbackBeanO(BeanO bean) // d662032 throws CSIException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "pushCallbackBeanO: " + bean); HandleListInterface hl = bean.reAssociateHandleList(); ivHandleListContext.beginContext(hl); ivCallbackBeanOStack.push(bean); }
java
public void pushCallbackBeanO(BeanO bean) // d662032 throws CSIException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "pushCallbackBeanO: " + bean); HandleListInterface hl = bean.reAssociateHandleList(); ivHandleListContext.beginContext(hl); ivCallbackBeanOStack.push(bean); }
[ "public", "void", "pushCallbackBeanO", "(", "BeanO", "bean", ")", "// d662032", "throws", "CSIException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"pushCallbackBeanO: \"", "+", "bean", ")", ";", "HandleListInterface", "hl", "=", "bean", ".", "reAssociateHandleList", "(", ")", ";", "ivHandleListContext", ".", "beginContext", "(", "hl", ")", ";", "ivCallbackBeanOStack", ".", "push", "(", "bean", ")", ";", "}" ]
Updates the bean that the container is currently processing via a business method or lifecycle callback, and establishes a thread context specific to the bean. @throws CSIException if an exception occurs while reassociating handles
[ "Updates", "the", "bean", "that", "the", "container", "is", "currently", "processing", "via", "a", "business", "method", "or", "lifecycle", "callback", "and", "establishes", "a", "thread", "context", "specific", "to", "the", "bean", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java#L222-L232
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java
EJBThreadData.pushClassLoader
public void pushClassLoader(BeanMetaData bmd) { ClassLoader classLoader = bmd.ivContextClassLoader; // F85059 Object origCL = svThreadContextAccessor.pushContextClassLoaderForUnprivileged(classLoader); ivClassLoaderStack.push(origCL); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "pushClassLoader: " + (origCL == ThreadContextAccessor.UNCHANGED ? "already " + Util.identity(classLoader) : Util.identity(origCL) + " -> " + Util.identity(classLoader))); }
java
public void pushClassLoader(BeanMetaData bmd) { ClassLoader classLoader = bmd.ivContextClassLoader; // F85059 Object origCL = svThreadContextAccessor.pushContextClassLoaderForUnprivileged(classLoader); ivClassLoaderStack.push(origCL); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "pushClassLoader: " + (origCL == ThreadContextAccessor.UNCHANGED ? "already " + Util.identity(classLoader) : Util.identity(origCL) + " -> " + Util.identity(classLoader))); }
[ "public", "void", "pushClassLoader", "(", "BeanMetaData", "bmd", ")", "{", "ClassLoader", "classLoader", "=", "bmd", ".", "ivContextClassLoader", ";", "// F85059", "Object", "origCL", "=", "svThreadContextAccessor", ".", "pushContextClassLoaderForUnprivileged", "(", "classLoader", ")", ";", "ivClassLoaderStack", ".", "push", "(", "origCL", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"pushClassLoader: \"", "+", "(", "origCL", "==", "ThreadContextAccessor", ".", "UNCHANGED", "?", "\"already \"", "+", "Util", ".", "identity", "(", "classLoader", ")", ":", "Util", ".", "identity", "(", "origCL", ")", "+", "\" -> \"", "+", "Util", ".", "identity", "(", "classLoader", ")", ")", ")", ";", "}" ]
Sets the thread context class loader for the specified bean metadata, and saves the current thread context class loader.
[ "Sets", "the", "thread", "context", "class", "loader", "for", "the", "specified", "bean", "metadata", "and", "saves", "the", "current", "thread", "context", "class", "loader", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java#L253-L264
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java
EJBThreadData.getContextData
public Map<String, Object> getContextData() // d644886 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); Map<String, Object> contextData; if (isLifecycleMethodActive()) // d704496 { if (ivLifecycleContextData == null) { ivLifecycleContextData = new HashMap<String, Object>(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: created empty"); } else { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: lifecycle"); } contextData = ivLifecycleContextData; } else { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: method"); EJSDeployedSupport s = getMethodContext(); if (s == null) { IllegalStateException ex = new IllegalStateException( "Context data not available outside the scope of an EJB or lifecycle callback method"); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: " + ex); throw ex; } contextData = s.getContextData(); } return contextData; }
java
public Map<String, Object> getContextData() // d644886 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); Map<String, Object> contextData; if (isLifecycleMethodActive()) // d704496 { if (ivLifecycleContextData == null) { ivLifecycleContextData = new HashMap<String, Object>(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: created empty"); } else { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: lifecycle"); } contextData = ivLifecycleContextData; } else { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: method"); EJSDeployedSupport s = getMethodContext(); if (s == null) { IllegalStateException ex = new IllegalStateException( "Context data not available outside the scope of an EJB or lifecycle callback method"); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "getContextData: " + ex); throw ex; } contextData = s.getContextData(); } return contextData; }
[ "public", "Map", "<", "String", ",", "Object", ">", "getContextData", "(", ")", "// d644886", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "Map", "<", "String", ",", "Object", ">", "contextData", ";", "if", "(", "isLifecycleMethodActive", "(", ")", ")", "// d704496", "{", "if", "(", "ivLifecycleContextData", "==", "null", ")", "{", "ivLifecycleContextData", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getContextData: created empty\"", ")", ";", "}", "else", "{", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getContextData: lifecycle\"", ")", ";", "}", "contextData", "=", "ivLifecycleContextData", ";", "}", "else", "{", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getContextData: method\"", ")", ";", "EJSDeployedSupport", "s", "=", "getMethodContext", "(", ")", ";", "if", "(", "s", "==", "null", ")", "{", "IllegalStateException", "ex", "=", "new", "IllegalStateException", "(", "\"Context data not available outside the scope of an EJB or lifecycle callback method\"", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getContextData: \"", "+", "ex", ")", ";", "throw", "ex", ";", "}", "contextData", "=", "s", ".", "getContextData", "(", ")", ";", "}", "return", "contextData", ";", "}" ]
Gets the context data associated with the current EJB method or EJB lifecycle callback. @see BeanO#getContextData @throws IllegalStateException if neither an EJB method nor an EJB lifecycle method is active on the thread
[ "Gets", "the", "context", "data", "associated", "with", "the", "current", "EJB", "method", "or", "EJB", "lifecycle", "callback", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBThreadData.java#L373-L414
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/Utils.java
Utils.getImpl
protected static Object getImpl(String className, Class[] types, Object[] args) { // No tracing as this is used to load the trace factory. Object Impl; // For return. try { Class classToInstantiate = Class.forName(className); java.lang.reflect.Constructor constructor = classToInstantiate.getDeclaredConstructor(types); constructor.setAccessible(true); Impl = constructor.newInstance(args); } catch (Exception exception) { // No FFDC Code Needed. // We may not have any FFDC instantiated so simply print the stack. exception.printStackTrace(new java.io.PrintWriter(System.out, true)); // Assume we have no chained exception support. throw new Error(exception.toString()); } // catch. return Impl; }
java
protected static Object getImpl(String className, Class[] types, Object[] args) { // No tracing as this is used to load the trace factory. Object Impl; // For return. try { Class classToInstantiate = Class.forName(className); java.lang.reflect.Constructor constructor = classToInstantiate.getDeclaredConstructor(types); constructor.setAccessible(true); Impl = constructor.newInstance(args); } catch (Exception exception) { // No FFDC Code Needed. // We may not have any FFDC instantiated so simply print the stack. exception.printStackTrace(new java.io.PrintWriter(System.out, true)); // Assume we have no chained exception support. throw new Error(exception.toString()); } // catch. return Impl; }
[ "protected", "static", "Object", "getImpl", "(", "String", "className", ",", "Class", "[", "]", "types", ",", "Object", "[", "]", "args", ")", "{", "// No tracing as this is used to load the trace factory.", "Object", "Impl", ";", "// For return.", "try", "{", "Class", "classToInstantiate", "=", "Class", ".", "forName", "(", "className", ")", ";", "java", ".", "lang", ".", "reflect", ".", "Constructor", "constructor", "=", "classToInstantiate", ".", "getDeclaredConstructor", "(", "types", ")", ";", "constructor", ".", "setAccessible", "(", "true", ")", ";", "Impl", "=", "constructor", ".", "newInstance", "(", "args", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "// No FFDC Code Needed.", "// We may not have any FFDC instantiated so simply print the stack. ", "exception", ".", "printStackTrace", "(", "new", "java", ".", "io", ".", "PrintWriter", "(", "System", ".", "out", ",", "true", ")", ")", ";", "// Assume we have no chained exception support.", "throw", "new", "Error", "(", "exception", ".", "toString", "(", ")", ")", ";", "}", "// catch.", "return", "Impl", ";", "}" ]
Create a platform specific instance of a utils class. @param className the simple name of the class whois implementation is to be found. @param types used to select the constructor. @param args used to invoke the constructor. @return Object the utils class loaded.
[ "Create", "a", "platform", "specific", "instance", "of", "a", "utils", "class", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/utils/Utils.java#L34-L53
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java
UniqueKeyRangeManager.scheduleUpdate
public void scheduleUpdate(UniqueKeyGenerator generator) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "scheduleUpdate", "GeneratorName="+generator.getName()); synchronized (_asyncQ) { _asyncQ.add(generator); _asyncQ.notify(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "scheduleUpdate"); }
java
public void scheduleUpdate(UniqueKeyGenerator generator) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "scheduleUpdate", "GeneratorName="+generator.getName()); synchronized (_asyncQ) { _asyncQ.add(generator); _asyncQ.notify(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "scheduleUpdate"); }
[ "public", "void", "scheduleUpdate", "(", "UniqueKeyGenerator", "generator", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"scheduleUpdate\"", ",", "\"GeneratorName=\"", "+", "generator", ".", "getName", "(", ")", ")", ";", "synchronized", "(", "_asyncQ", ")", "{", "_asyncQ", ".", "add", "(", "generator", ")", ";", "_asyncQ", ".", "notify", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"scheduleUpdate\"", ")", ";", "}" ]
Request an asynchronous update of the persistent state @param generator to be updated
[ "Request", "an", "asynchronous", "update", "of", "the", "persistent", "state" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java#L131-L142
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java
UniqueKeyRangeManager.entryExists
public boolean entryExists(UniqueKeyGenerator generator) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "entryExists", "GeneratorName="+generator.getName()); boolean retval = false; if (_generators.containsKey(generator.getName())) { retval = true; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "entryExists", "retrun="+retval); return retval; }
java
public boolean entryExists(UniqueKeyGenerator generator) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "entryExists", "GeneratorName="+generator.getName()); boolean retval = false; if (_generators.containsKey(generator.getName())) { retval = true; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "entryExists", "retrun="+retval); return retval; }
[ "public", "boolean", "entryExists", "(", "UniqueKeyGenerator", "generator", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"entryExists\"", ",", "\"GeneratorName=\"", "+", "generator", ".", "getName", "(", ")", ")", ";", "boolean", "retval", "=", "false", ";", "if", "(", "_generators", ".", "containsKey", "(", "generator", ".", "getName", "(", ")", ")", ")", "{", "retval", "=", "true", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"entryExists\"", ",", "\"retrun=\"", "+", "retval", ")", ";", "return", "retval", ";", "}" ]
Test if the generator is known to the persistence layer @param generator to check for @return true if generator exists, false otherwise
[ "Test", "if", "the", "generator", "is", "known", "to", "the", "persistence", "layer" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java#L151-L164
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java
UniqueKeyRangeManager.addEntry
public long addEntry(UniqueKeyGenerator generator) throws PersistenceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addEntry", "GeneratorName="+generator.getName()); if (!_generators.containsKey(generator.getName())) { Transaction transaction = null; try { transaction = _objectManager.getTransaction(); // Add the ManagedObject for this generator UniqueKeyGeneratorManagedObject uniqueKey = new UniqueKeyGeneratorManagedObject(generator); Token uniqueKeyToken = _objectStore.allocate(uniqueKey); transaction.add(uniqueKey); // Add token to the list of generators LinkedList list = (LinkedList)_uniqueKeyRootToken.getManagedObject(); list.add(uniqueKeyToken, transaction); // Commit all of the work transaction.commit(false); // Store the token in our list to access at runtime. _generators.put(generator.getName(), uniqueKey); } catch (ObjectManagerException ome) { com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.addEntry", "1:217:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught creating new unique key generator!", ome); if (transaction != null) { try { // Clean up our ObjectManager work. transaction.backout(false); } catch (ObjectManagerException e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.addEntry", "1:229:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught backing out unique key generator creation!", e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addEntry"); throw new PersistenceException("Exception caught creating new unique key generator!", ome); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addEntry", "return="+UNIQUE_KEY_INITIAL_VALUE); return UNIQUE_KEY_INITIAL_VALUE; }
java
public long addEntry(UniqueKeyGenerator generator) throws PersistenceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addEntry", "GeneratorName="+generator.getName()); if (!_generators.containsKey(generator.getName())) { Transaction transaction = null; try { transaction = _objectManager.getTransaction(); // Add the ManagedObject for this generator UniqueKeyGeneratorManagedObject uniqueKey = new UniqueKeyGeneratorManagedObject(generator); Token uniqueKeyToken = _objectStore.allocate(uniqueKey); transaction.add(uniqueKey); // Add token to the list of generators LinkedList list = (LinkedList)_uniqueKeyRootToken.getManagedObject(); list.add(uniqueKeyToken, transaction); // Commit all of the work transaction.commit(false); // Store the token in our list to access at runtime. _generators.put(generator.getName(), uniqueKey); } catch (ObjectManagerException ome) { com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.addEntry", "1:217:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught creating new unique key generator!", ome); if (transaction != null) { try { // Clean up our ObjectManager work. transaction.backout(false); } catch (ObjectManagerException e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.addEntry", "1:229:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught backing out unique key generator creation!", e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addEntry"); throw new PersistenceException("Exception caught creating new unique key generator!", ome); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addEntry", "return="+UNIQUE_KEY_INITIAL_VALUE); return UNIQUE_KEY_INITIAL_VALUE; }
[ "public", "long", "addEntry", "(", "UniqueKeyGenerator", "generator", ")", "throws", "PersistenceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"addEntry\"", ",", "\"GeneratorName=\"", "+", "generator", ".", "getName", "(", ")", ")", ";", "if", "(", "!", "_generators", ".", "containsKey", "(", "generator", ".", "getName", "(", ")", ")", ")", "{", "Transaction", "transaction", "=", "null", ";", "try", "{", "transaction", "=", "_objectManager", ".", "getTransaction", "(", ")", ";", "// Add the ManagedObject for this generator", "UniqueKeyGeneratorManagedObject", "uniqueKey", "=", "new", "UniqueKeyGeneratorManagedObject", "(", "generator", ")", ";", "Token", "uniqueKeyToken", "=", "_objectStore", ".", "allocate", "(", "uniqueKey", ")", ";", "transaction", ".", "add", "(", "uniqueKey", ")", ";", "// Add token to the list of generators", "LinkedList", "list", "=", "(", "LinkedList", ")", "_uniqueKeyRootToken", ".", "getManagedObject", "(", ")", ";", "list", ".", "add", "(", "uniqueKeyToken", ",", "transaction", ")", ";", "// Commit all of the work", "transaction", ".", "commit", "(", "false", ")", ";", "// Store the token in our list to access at runtime.", "_generators", ".", "put", "(", "generator", ".", "getName", "(", ")", ",", "uniqueKey", ")", ";", "}", "catch", "(", "ObjectManagerException", "ome", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "ome", ",", "\"com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.addEntry\"", ",", "\"1:217:1.8\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "tc", ",", "\"Exception caught creating new unique key generator!\"", ",", "ome", ")", ";", "if", "(", "transaction", "!=", "null", ")", "{", "try", "{", "// Clean up our ObjectManager work.", "transaction", ".", "backout", "(", "false", ")", ";", "}", "catch", "(", "ObjectManagerException", "e", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.addEntry\"", ",", "\"1:229:1.8\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "tc", ",", "\"Exception caught backing out unique key generator creation!\"", ",", "e", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"addEntry\"", ")", ";", "throw", "new", "PersistenceException", "(", "\"Exception caught creating new unique key generator!\"", ",", "ome", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"addEntry\"", ",", "\"return=\"", "+", "UNIQUE_KEY_INITIAL_VALUE", ")", ";", "return", "UNIQUE_KEY_INITIAL_VALUE", ";", "}" ]
Tell the persistence layer about a new generator @param generator @return initial key to be used by the generator @throws PersistenceException
[ "Tell", "the", "persistence", "layer", "about", "a", "new", "generator" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java#L174-L227
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java
UniqueKeyRangeManager.updateEntry
public long updateEntry(UniqueKeyGenerator generator) throws PersistenceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateEntry", "GeneratorName="+generator.getName()); long currentLimit = 0L; // Do we know of this generator? if (_generators.containsKey(generator.getName())) { Transaction transaction = null; try { transaction = _objectManager.getTransaction(); // Replace the ManagedObject for this generator UniqueKeyGeneratorManagedObject mo = (UniqueKeyGeneratorManagedObject)_generators.get(generator.getName()); // Lock the token so we can make our changes. transaction.lock(mo); // Update the value in the managed object to the // new increased limit. synchronized (mo) { currentLimit = mo.getGeneratorKeyLimit(); mo.setGeneratorKeyLimit(currentLimit + generator.getRange()); } // Use replace to update the contents. transaction.replace(mo); transaction.commit(false); } catch (ObjectManagerException ome) { com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.updateEntry", "1:286:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught increasing range of unique key generator!", ome); if (transaction != null) { try { // Clean up our ObjectManager work. transaction.backout(false); } catch (ObjectManagerException e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.updateEntry", "1:298:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught backing out unique key generator update!", e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateEntry"); throw new PersistenceException("Exception caught increasing range of unique key generator!", ome); } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "No UniqueKeyGenerator matching: "+generator.getName()+" found to update!"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateEntry"); throw new PersistenceException("No UniqueKeyGenerator matching: "+generator.getName()+" found to update!"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateEntry", "return="+currentLimit); return currentLimit; }
java
public long updateEntry(UniqueKeyGenerator generator) throws PersistenceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateEntry", "GeneratorName="+generator.getName()); long currentLimit = 0L; // Do we know of this generator? if (_generators.containsKey(generator.getName())) { Transaction transaction = null; try { transaction = _objectManager.getTransaction(); // Replace the ManagedObject for this generator UniqueKeyGeneratorManagedObject mo = (UniqueKeyGeneratorManagedObject)_generators.get(generator.getName()); // Lock the token so we can make our changes. transaction.lock(mo); // Update the value in the managed object to the // new increased limit. synchronized (mo) { currentLimit = mo.getGeneratorKeyLimit(); mo.setGeneratorKeyLimit(currentLimit + generator.getRange()); } // Use replace to update the contents. transaction.replace(mo); transaction.commit(false); } catch (ObjectManagerException ome) { com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.updateEntry", "1:286:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught increasing range of unique key generator!", ome); if (transaction != null) { try { // Clean up our ObjectManager work. transaction.backout(false); } catch (ObjectManagerException e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.updateEntry", "1:298:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught backing out unique key generator update!", e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateEntry"); throw new PersistenceException("Exception caught increasing range of unique key generator!", ome); } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "No UniqueKeyGenerator matching: "+generator.getName()+" found to update!"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateEntry"); throw new PersistenceException("No UniqueKeyGenerator matching: "+generator.getName()+" found to update!"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateEntry", "return="+currentLimit); return currentLimit; }
[ "public", "long", "updateEntry", "(", "UniqueKeyGenerator", "generator", ")", "throws", "PersistenceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"updateEntry\"", ",", "\"GeneratorName=\"", "+", "generator", ".", "getName", "(", ")", ")", ";", "long", "currentLimit", "=", "0L", ";", "// Do we know of this generator?", "if", "(", "_generators", ".", "containsKey", "(", "generator", ".", "getName", "(", ")", ")", ")", "{", "Transaction", "transaction", "=", "null", ";", "try", "{", "transaction", "=", "_objectManager", ".", "getTransaction", "(", ")", ";", "// Replace the ManagedObject for this generator", "UniqueKeyGeneratorManagedObject", "mo", "=", "(", "UniqueKeyGeneratorManagedObject", ")", "_generators", ".", "get", "(", "generator", ".", "getName", "(", ")", ")", ";", "// Lock the token so we can make our changes.", "transaction", ".", "lock", "(", "mo", ")", ";", "// Update the value in the managed object to the ", "// new increased limit.", "synchronized", "(", "mo", ")", "{", "currentLimit", "=", "mo", ".", "getGeneratorKeyLimit", "(", ")", ";", "mo", ".", "setGeneratorKeyLimit", "(", "currentLimit", "+", "generator", ".", "getRange", "(", ")", ")", ";", "}", "// Use replace to update the contents.", "transaction", ".", "replace", "(", "mo", ")", ";", "transaction", ".", "commit", "(", "false", ")", ";", "}", "catch", "(", "ObjectManagerException", "ome", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "ome", ",", "\"com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.updateEntry\"", ",", "\"1:286:1.8\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "tc", ",", "\"Exception caught increasing range of unique key generator!\"", ",", "ome", ")", ";", "if", "(", "transaction", "!=", "null", ")", "{", "try", "{", "// Clean up our ObjectManager work.", "transaction", ".", "backout", "(", "false", ")", ";", "}", "catch", "(", "ObjectManagerException", "e", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.updateEntry\"", ",", "\"1:298:1.8\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "tc", ",", "\"Exception caught backing out unique key generator update!\"", ",", "e", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"updateEntry\"", ")", ";", "throw", "new", "PersistenceException", "(", "\"Exception caught increasing range of unique key generator!\"", ",", "ome", ")", ";", "}", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "tc", ",", "\"No UniqueKeyGenerator matching: \"", "+", "generator", ".", "getName", "(", ")", "+", "\" found to update!\"", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"updateEntry\"", ")", ";", "throw", "new", "PersistenceException", "(", "\"No UniqueKeyGenerator matching: \"", "+", "generator", ".", "getName", "(", ")", "+", "\" found to update!\"", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"updateEntry\"", ",", "\"return=\"", "+", "currentLimit", ")", ";", "return", "currentLimit", ";", "}" ]
Request an immediate update to the persistent state @param generator to be updated @return the value that was stored prior to the update @throws PersistenceException
[ "Request", "an", "immediate", "update", "to", "the", "persistent", "state" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java#L237-L302
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java
UniqueKeyRangeManager.run
public void run() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "run"); UniqueKeyGenerator generator = null; while (_running) { synchronized (_asyncQ) { // Do we have anything to do? while (_asyncQ.isEmpty()) { // If not we need to wait until told // that we do. try { _asyncQ.wait(); } catch (InterruptedException ie) { // No FFDC Code Needed. } // If we have been woken up because we are // stopping then we can simply return here if (!_running) { return; } } generator = (UniqueKeyGenerator)_asyncQ.removeFirst(); } // Carry out the requested updates. try { updateEntry(generator); } catch (PersistenceException pe) { com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.run", "1:366:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught asynchronously increasing range of unique key generator!", pe); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "run"); }
java
public void run() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "run"); UniqueKeyGenerator generator = null; while (_running) { synchronized (_asyncQ) { // Do we have anything to do? while (_asyncQ.isEmpty()) { // If not we need to wait until told // that we do. try { _asyncQ.wait(); } catch (InterruptedException ie) { // No FFDC Code Needed. } // If we have been woken up because we are // stopping then we can simply return here if (!_running) { return; } } generator = (UniqueKeyGenerator)_asyncQ.removeFirst(); } // Carry out the requested updates. try { updateEntry(generator); } catch (PersistenceException pe) { com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.run", "1:366:1.8", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.event(tc, "Exception caught asynchronously increasing range of unique key generator!", pe); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "run"); }
[ "public", "void", "run", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"run\"", ")", ";", "UniqueKeyGenerator", "generator", "=", "null", ";", "while", "(", "_running", ")", "{", "synchronized", "(", "_asyncQ", ")", "{", "// Do we have anything to do? ", "while", "(", "_asyncQ", ".", "isEmpty", "(", ")", ")", "{", "// If not we need to wait until told", "// that we do.", "try", "{", "_asyncQ", ".", "wait", "(", ")", ";", "}", "catch", "(", "InterruptedException", "ie", ")", "{", "// No FFDC Code Needed.", "}", "// If we have been woken up because we are ", "// stopping then we can simply return here", "if", "(", "!", "_running", ")", "{", "return", ";", "}", "}", "generator", "=", "(", "UniqueKeyGenerator", ")", "_asyncQ", ".", "removeFirst", "(", ")", ";", "}", "// Carry out the requested updates.", "try", "{", "updateEntry", "(", "generator", ")", ";", "}", "catch", "(", "PersistenceException", "pe", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "pe", ",", "\"com.ibm.ws.sib.msgstore.persistence.objectManager.UniqueKeyRangeManager.run\"", ",", "\"1:366:1.8\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "tc", ",", "\"Exception caught asynchronously increasing range of unique key generator!\"", ",", "pe", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"run\"", ")", ";", "}" ]
This method is where the asynchronous reads and writes are done to the filesystem for persistent updates to the currently active range of keys.
[ "This", "method", "is", "where", "the", "asynchronous", "reads", "and", "writes", "are", "done", "to", "the", "filesystem", "for", "persistent", "updates", "to", "the", "currently", "active", "range", "of", "keys", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyRangeManager.java#L310-L358
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/client/injection/ServiceRefObjectFactory.java
ServiceRefObjectFactory.getInstance
private Object getInstance(TransientWebServiceRefInfo tInfo, WebServiceRefInfo wsrInfo) throws Exception { Object instance = null; // First, obtain an instance of the JAX-WS Service class. Service svc = null; List<WebServiceFeature> originalWsFeatureList = LibertyProviderImpl.getWebServiceFeatures(); WebServiceRefInfo originalWebServiceRefInfo = LibertyProviderImpl.getWebServiceRefInfo(); try { //Check @MTOM @RespectBinding @Addressing //set web service features to ThreadLocal final List<WebServiceFeature> wsFeatureList = wsrInfo.getWSFeatureForSEIClass(wsrInfo.getServiceRefTypeClassName()); LibertyProviderImpl.setWebServiceRefInfo(wsrInfo); LibertyProviderImpl.setWebServiceFeatures(wsFeatureList); svc = getServiceInstance(tInfo, wsrInfo); } finally { LibertyProviderImpl.setWebServiceFeatures(originalWsFeatureList); LibertyProviderImpl.setWebServiceRefInfo(originalWebServiceRefInfo); } // Set handlerResolver svc.setHandlerResolver(new JaxWsClientHandlerResolver(tInfo.getWebServiceRefInfo(), tInfo.getClientMetaData())); // Next, retrieve the "type" class, which corresponds to the service-ref-type attribute. // If the "typeClass" is *not* the default (Object.class) *and* it's also not a subclass of the Service class, // then we have a situation where the user wants to do a port-type injection. // In that case, we need to call Service.getPort() on the service instance we just obtained above. Class<?> typeClass = tInfo.getServiceRefTypeClass(); if (typeClass != null && !typeClass.getName().equals(Object.class.getName()) && !Service.class.isAssignableFrom(typeClass)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Creating a port instance based on class: " + tInfo.getServiceRefTypeClass().getName()); } instance = svc.getPort(typeClass); } else {// Otherwise, this was just a normal Service-type injection so we'll return the service. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Service instance created based on class: " + svc.getClass().getName()); } instance = svc; } return instance; }
java
private Object getInstance(TransientWebServiceRefInfo tInfo, WebServiceRefInfo wsrInfo) throws Exception { Object instance = null; // First, obtain an instance of the JAX-WS Service class. Service svc = null; List<WebServiceFeature> originalWsFeatureList = LibertyProviderImpl.getWebServiceFeatures(); WebServiceRefInfo originalWebServiceRefInfo = LibertyProviderImpl.getWebServiceRefInfo(); try { //Check @MTOM @RespectBinding @Addressing //set web service features to ThreadLocal final List<WebServiceFeature> wsFeatureList = wsrInfo.getWSFeatureForSEIClass(wsrInfo.getServiceRefTypeClassName()); LibertyProviderImpl.setWebServiceRefInfo(wsrInfo); LibertyProviderImpl.setWebServiceFeatures(wsFeatureList); svc = getServiceInstance(tInfo, wsrInfo); } finally { LibertyProviderImpl.setWebServiceFeatures(originalWsFeatureList); LibertyProviderImpl.setWebServiceRefInfo(originalWebServiceRefInfo); } // Set handlerResolver svc.setHandlerResolver(new JaxWsClientHandlerResolver(tInfo.getWebServiceRefInfo(), tInfo.getClientMetaData())); // Next, retrieve the "type" class, which corresponds to the service-ref-type attribute. // If the "typeClass" is *not* the default (Object.class) *and* it's also not a subclass of the Service class, // then we have a situation where the user wants to do a port-type injection. // In that case, we need to call Service.getPort() on the service instance we just obtained above. Class<?> typeClass = tInfo.getServiceRefTypeClass(); if (typeClass != null && !typeClass.getName().equals(Object.class.getName()) && !Service.class.isAssignableFrom(typeClass)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Creating a port instance based on class: " + tInfo.getServiceRefTypeClass().getName()); } instance = svc.getPort(typeClass); } else {// Otherwise, this was just a normal Service-type injection so we'll return the service. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Service instance created based on class: " + svc.getClass().getName()); } instance = svc; } return instance; }
[ "private", "Object", "getInstance", "(", "TransientWebServiceRefInfo", "tInfo", ",", "WebServiceRefInfo", "wsrInfo", ")", "throws", "Exception", "{", "Object", "instance", "=", "null", ";", "// First, obtain an instance of the JAX-WS Service class.", "Service", "svc", "=", "null", ";", "List", "<", "WebServiceFeature", ">", "originalWsFeatureList", "=", "LibertyProviderImpl", ".", "getWebServiceFeatures", "(", ")", ";", "WebServiceRefInfo", "originalWebServiceRefInfo", "=", "LibertyProviderImpl", ".", "getWebServiceRefInfo", "(", ")", ";", "try", "{", "//Check @MTOM @RespectBinding @Addressing ", "//set web service features to ThreadLocal", "final", "List", "<", "WebServiceFeature", ">", "wsFeatureList", "=", "wsrInfo", ".", "getWSFeatureForSEIClass", "(", "wsrInfo", ".", "getServiceRefTypeClassName", "(", ")", ")", ";", "LibertyProviderImpl", ".", "setWebServiceRefInfo", "(", "wsrInfo", ")", ";", "LibertyProviderImpl", ".", "setWebServiceFeatures", "(", "wsFeatureList", ")", ";", "svc", "=", "getServiceInstance", "(", "tInfo", ",", "wsrInfo", ")", ";", "}", "finally", "{", "LibertyProviderImpl", ".", "setWebServiceFeatures", "(", "originalWsFeatureList", ")", ";", "LibertyProviderImpl", ".", "setWebServiceRefInfo", "(", "originalWebServiceRefInfo", ")", ";", "}", "// Set handlerResolver", "svc", ".", "setHandlerResolver", "(", "new", "JaxWsClientHandlerResolver", "(", "tInfo", ".", "getWebServiceRefInfo", "(", ")", ",", "tInfo", ".", "getClientMetaData", "(", ")", ")", ")", ";", "// Next, retrieve the \"type\" class, which corresponds to the service-ref-type attribute.", "// If the \"typeClass\" is *not* the default (Object.class) *and* it's also not a subclass of the Service class,", "// then we have a situation where the user wants to do a port-type injection.", "// In that case, we need to call Service.getPort() on the service instance we just obtained above.", "Class", "<", "?", ">", "typeClass", "=", "tInfo", ".", "getServiceRefTypeClass", "(", ")", ";", "if", "(", "typeClass", "!=", "null", "&&", "!", "typeClass", ".", "getName", "(", ")", ".", "equals", "(", "Object", ".", "class", ".", "getName", "(", ")", ")", "&&", "!", "Service", ".", "class", ".", "isAssignableFrom", "(", "typeClass", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Creating a port instance based on class: \"", "+", "tInfo", ".", "getServiceRefTypeClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "instance", "=", "svc", ".", "getPort", "(", "typeClass", ")", ";", "}", "else", "{", "// Otherwise, this was just a normal Service-type injection so we'll return the service.", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Service instance created based on class: \"", "+", "svc", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "instance", "=", "svc", ";", "}", "return", "instance", ";", "}" ]
This method will create an instance of a JAX-WS service ref, using the metadata supplied in the WebServiceRefInfo object.
[ "This", "method", "will", "create", "an", "instance", "of", "a", "JAX", "-", "WS", "service", "ref", "using", "the", "metadata", "supplied", "in", "the", "WebServiceRefInfo", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/client/injection/ServiceRefObjectFactory.java#L176-L222
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.authentication.filter/src/com/ibm/ws/security/authentication/filter/internal/OrCondition.java
OrCondition.checkCondition
@Override public boolean checkCondition(IValue test) throws FilterException { Iterator iter = values.iterator(); while (iter.hasNext()) { IValue value = (IValue) iter.next(); if (value.containedBy(test)) { return true; } } return false; }
java
@Override public boolean checkCondition(IValue test) throws FilterException { Iterator iter = values.iterator(); while (iter.hasNext()) { IValue value = (IValue) iter.next(); if (value.containedBy(test)) { return true; } } return false; }
[ "@", "Override", "public", "boolean", "checkCondition", "(", "IValue", "test", ")", "throws", "FilterException", "{", "Iterator", "iter", "=", "values", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "IValue", "value", "=", "(", "IValue", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "value", ".", "containedBy", "(", "test", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Loop through all of the values and see if any of them pass the equality test
[ "Loop", "through", "all", "of", "the", "values", "and", "see", "if", "any", "of", "them", "pass", "the", "equality", "test" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.filter/src/com/ibm/ws/security/authentication/filter/internal/OrCondition.java#L44-L54
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/dataobject/IDAndRealm.java
IDAndRealm.setRealm
public void setRealm(String inputRealm) { if ((inputRealm != null) && (!inputRealm.equals(""))) { this.realm = inputRealm; setRealmDefined(true); } }
java
public void setRealm(String inputRealm) { if ((inputRealm != null) && (!inputRealm.equals(""))) { this.realm = inputRealm; setRealmDefined(true); } }
[ "public", "void", "setRealm", "(", "String", "inputRealm", ")", "{", "if", "(", "(", "inputRealm", "!=", "null", ")", "&&", "(", "!", "inputRealm", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "this", ".", "realm", "=", "inputRealm", ";", "setRealmDefined", "(", "true", ")", ";", "}", "}" ]
Set the realm. @param inputRealm The realm to set. @pre inputRealm != null @pre inputRealm != ""
[ "Set", "the", "realm", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/dataobject/IDAndRealm.java#L101-L106
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/upgrade/H2HandlerImpl.java
H2HandlerImpl.isH2Request
@Override public boolean isH2Request(HttpInboundConnection hic, ServletRequest request) throws ServletException { //first check if H2 is enabled for this channel/port if (!((Http2InboundConnection)hic).isHTTP2UpgradeRequest(null, true) ){ return false; } Map<String, String> headers = new HashMap<String, String>(); HttpServletRequest hsrt = (HttpServletRequest) request; Enumeration<String> headerNames = hsrt.getHeaderNames(); // create a map of the headers to pass to the transport code while (headerNames.hasMoreElements()) { String key = (String) headerNames.nextElement(); String value = hsrt.getHeader(key); headers.put(key, value); } //check if this request is asking to do H2 return ((Http2InboundConnection)hic).isHTTP2UpgradeRequest(headers, false); }
java
@Override public boolean isH2Request(HttpInboundConnection hic, ServletRequest request) throws ServletException { //first check if H2 is enabled for this channel/port if (!((Http2InboundConnection)hic).isHTTP2UpgradeRequest(null, true) ){ return false; } Map<String, String> headers = new HashMap<String, String>(); HttpServletRequest hsrt = (HttpServletRequest) request; Enumeration<String> headerNames = hsrt.getHeaderNames(); // create a map of the headers to pass to the transport code while (headerNames.hasMoreElements()) { String key = (String) headerNames.nextElement(); String value = hsrt.getHeader(key); headers.put(key, value); } //check if this request is asking to do H2 return ((Http2InboundConnection)hic).isHTTP2UpgradeRequest(headers, false); }
[ "@", "Override", "public", "boolean", "isH2Request", "(", "HttpInboundConnection", "hic", ",", "ServletRequest", "request", ")", "throws", "ServletException", "{", "//first check if H2 is enabled for this channel/port", "if", "(", "!", "(", "(", "Http2InboundConnection", ")", "hic", ")", ".", "isHTTP2UpgradeRequest", "(", "null", ",", "true", ")", ")", "{", "return", "false", ";", "}", "Map", "<", "String", ",", "String", ">", "headers", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "HttpServletRequest", "hsrt", "=", "(", "HttpServletRequest", ")", "request", ";", "Enumeration", "<", "String", ">", "headerNames", "=", "hsrt", ".", "getHeaderNames", "(", ")", ";", "// create a map of the headers to pass to the transport code", "while", "(", "headerNames", ".", "hasMoreElements", "(", ")", ")", "{", "String", "key", "=", "(", "String", ")", "headerNames", ".", "nextElement", "(", ")", ";", "String", "value", "=", "hsrt", ".", "getHeader", "(", "key", ")", ";", "headers", ".", "put", "(", "key", ",", "value", ")", ";", "}", "//check if this request is asking to do H2", "return", "(", "(", "Http2InboundConnection", ")", "hic", ")", ".", "isHTTP2UpgradeRequest", "(", "headers", ",", "false", ")", ";", "}" ]
Determines if a given request is an http2 upgrade request
[ "Determines", "if", "a", "given", "request", "is", "an", "http2", "upgrade", "request" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/upgrade/H2HandlerImpl.java#L40-L60
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/upgrade/H2HandlerImpl.java
H2HandlerImpl.handleRequest
@Override public void handleRequest(HttpInboundConnection hic, HttpServletRequest request, HttpServletResponse response) { Http2InboundConnection h2ic = (Http2InboundConnection) hic; H2UpgradeHandlerWrapper h2uh = null; try { h2uh = request.upgrade(H2UpgradeHandlerWrapper.class); } catch (IOException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "returning: user configurator threw an IOException. Exception message: " + e.getMessage()); } response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; } catch (ServletException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "returning: user configurator threw a ServletException. Exception message: " + e.getMessage()); } response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; } if (h2uh != null) { h2uh.init(new H2UpgradeHandler()); } // create a map of the headers to pass to the transport code Map<String, String> headers = new HashMap<String, String>(); HttpServletRequest hsrt = (HttpServletRequest) request; Enumeration<String> headerNames = hsrt.getHeaderNames(); while (headerNames.hasMoreElements()) { String key = (String) headerNames.nextElement(); String value = hsrt.getHeader(key); headers.put(key, value); } boolean upgraded = h2ic.handleHTTP2UpgradeRequest(headers); if (!upgraded) { if (tc.isDebugEnabled()) { Tr.debug(tc, "returning: http2 connection initialization failed"); } response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
java
@Override public void handleRequest(HttpInboundConnection hic, HttpServletRequest request, HttpServletResponse response) { Http2InboundConnection h2ic = (Http2InboundConnection) hic; H2UpgradeHandlerWrapper h2uh = null; try { h2uh = request.upgrade(H2UpgradeHandlerWrapper.class); } catch (IOException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "returning: user configurator threw an IOException. Exception message: " + e.getMessage()); } response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; } catch (ServletException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "returning: user configurator threw a ServletException. Exception message: " + e.getMessage()); } response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; } if (h2uh != null) { h2uh.init(new H2UpgradeHandler()); } // create a map of the headers to pass to the transport code Map<String, String> headers = new HashMap<String, String>(); HttpServletRequest hsrt = (HttpServletRequest) request; Enumeration<String> headerNames = hsrt.getHeaderNames(); while (headerNames.hasMoreElements()) { String key = (String) headerNames.nextElement(); String value = hsrt.getHeader(key); headers.put(key, value); } boolean upgraded = h2ic.handleHTTP2UpgradeRequest(headers); if (!upgraded) { if (tc.isDebugEnabled()) { Tr.debug(tc, "returning: http2 connection initialization failed"); } response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
[ "@", "Override", "public", "void", "handleRequest", "(", "HttpInboundConnection", "hic", ",", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "Http2InboundConnection", "h2ic", "=", "(", "Http2InboundConnection", ")", "hic", ";", "H2UpgradeHandlerWrapper", "h2uh", "=", "null", ";", "try", "{", "h2uh", "=", "request", ".", "upgrade", "(", "H2UpgradeHandlerWrapper", ".", "class", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"returning: user configurator threw an IOException. Exception message: \"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "response", ".", "setStatus", "(", "HttpServletResponse", ".", "SC_INTERNAL_SERVER_ERROR", ")", ";", "return", ";", "}", "catch", "(", "ServletException", "e", ")", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"returning: user configurator threw a ServletException. Exception message: \"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "response", ".", "setStatus", "(", "HttpServletResponse", ".", "SC_INTERNAL_SERVER_ERROR", ")", ";", "return", ";", "}", "if", "(", "h2uh", "!=", "null", ")", "{", "h2uh", ".", "init", "(", "new", "H2UpgradeHandler", "(", ")", ")", ";", "}", "// create a map of the headers to pass to the transport code", "Map", "<", "String", ",", "String", ">", "headers", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "HttpServletRequest", "hsrt", "=", "(", "HttpServletRequest", ")", "request", ";", "Enumeration", "<", "String", ">", "headerNames", "=", "hsrt", ".", "getHeaderNames", "(", ")", ";", "while", "(", "headerNames", ".", "hasMoreElements", "(", ")", ")", "{", "String", "key", "=", "(", "String", ")", "headerNames", ".", "nextElement", "(", ")", ";", "String", "value", "=", "hsrt", ".", "getHeader", "(", "key", ")", ";", "headers", ".", "put", "(", "key", ",", "value", ")", ";", "}", "boolean", "upgraded", "=", "h2ic", ".", "handleHTTP2UpgradeRequest", "(", "headers", ")", ";", "if", "(", "!", "upgraded", ")", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"returning: http2 connection initialization failed\"", ")", ";", "}", "response", ".", "setStatus", "(", "HttpServletResponse", ".", "SC_INTERNAL_SERVER_ERROR", ")", ";", "}", "}" ]
Upgrades the given request for http2
[ "Upgrades", "the", "given", "request", "for", "http2" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.3.1/src/com/ibm/ws/webcontainer31/upgrade/H2HandlerImpl.java#L65-L106
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSConnectionEvent.java
WSConnectionEvent.recycle
public final WSConnectionEvent recycle(int eid, Exception ex, Object handle) { id = eid; exception = ex; setConnectionHandle(handle); return this; }
java
public final WSConnectionEvent recycle(int eid, Exception ex, Object handle) { id = eid; exception = ex; setConnectionHandle(handle); return this; }
[ "public", "final", "WSConnectionEvent", "recycle", "(", "int", "eid", ",", "Exception", "ex", ",", "Object", "handle", ")", "{", "id", "=", "eid", ";", "exception", "=", "ex", ";", "setConnectionHandle", "(", "handle", ")", ";", "return", "this", ";", "}" ]
Recycle this ConnectionEvent by replacing the current values with those for the new event. @param eid ConnectionEvent constant indicating the type of ConnectionEvent. @param ex the exception about to be throw to the application, or null if none. @param handle Connection handle on which the error occurred, or null if none. @return ConnectionEvent with the specified parameters.
[ "Recycle", "this", "ConnectionEvent", "by", "replacing", "the", "current", "values", "with", "those", "for", "the", "new", "event", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSConnectionEvent.java#L79-L86
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java
SSLWriteServiceContext.encryptAndWriteAsync
public VirtualConnection encryptAndWriteAsync(long numBytes, boolean forceQueue, int timeout) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "encryptAndWriteAsync: " + numBytes); } this.asyncBytesToWrite = 0L; this.asyncTimeout = timeout; VirtualConnection vc = null; try { long numBytesLeft = numBytes; // make sure we have an output buffer of the target size ready final int packetSize = getConnLink().getPacketBufferSize(); if (numBytesLeft > packetSize) { getEncryptedAppBuffer(packetSize * 2); } else { getEncryptedAppBuffer(1); } final int cap = this.encryptedAppBuffer.capacity(); final TCPWriteRequestContext tcp = getConnLink().getDeviceWriteInterface(); SSLEngineResult result; int produced; do { this.encryptedAppBuffer.clear(); result = encryptMessage(); numBytesLeft -= result.bytesConsumed(); produced = result.bytesProduced(); if (0 < produced) { while (0 < numBytesLeft && (cap - produced) >= packetSize) { // space in the current output buffer to encrypt a little more // Note: JSSE requires a full packet size of open space regardless of the input // amount, so even 100 bytes to encrypt requires 16K of output space result = encryptMessage(); numBytesLeft -= result.bytesConsumed(); produced += result.bytesProduced(); } // in case this goes async, save bytes-left to pick up later this.asyncBytesToWrite = numBytesLeft; this.encryptedAppBuffer.flip(); tcp.setBuffer(this.encryptedAppBuffer); vc = tcp.write(TCPWriteRequestContext.WRITE_ALL_DATA, this, forceQueue, timeout); } } while (null != vc && 0 < numBytesLeft && 0 < produced); } catch (IOException exception) { // No FFDC needed. Callback will handle. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception during encryption, " + exception); } this.callback.error(getConnLink().getVirtualConnection(), this, exception); } catch (Exception original) { synchronized (closeSync) { // if close has been called then assume this exception was due to a race condition // with the close logic. so no FFDC here. if (closeCalled) { return null; } else { throw original; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "encryptAndWriteAsync: " + vc); } return vc; }
java
public VirtualConnection encryptAndWriteAsync(long numBytes, boolean forceQueue, int timeout) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "encryptAndWriteAsync: " + numBytes); } this.asyncBytesToWrite = 0L; this.asyncTimeout = timeout; VirtualConnection vc = null; try { long numBytesLeft = numBytes; // make sure we have an output buffer of the target size ready final int packetSize = getConnLink().getPacketBufferSize(); if (numBytesLeft > packetSize) { getEncryptedAppBuffer(packetSize * 2); } else { getEncryptedAppBuffer(1); } final int cap = this.encryptedAppBuffer.capacity(); final TCPWriteRequestContext tcp = getConnLink().getDeviceWriteInterface(); SSLEngineResult result; int produced; do { this.encryptedAppBuffer.clear(); result = encryptMessage(); numBytesLeft -= result.bytesConsumed(); produced = result.bytesProduced(); if (0 < produced) { while (0 < numBytesLeft && (cap - produced) >= packetSize) { // space in the current output buffer to encrypt a little more // Note: JSSE requires a full packet size of open space regardless of the input // amount, so even 100 bytes to encrypt requires 16K of output space result = encryptMessage(); numBytesLeft -= result.bytesConsumed(); produced += result.bytesProduced(); } // in case this goes async, save bytes-left to pick up later this.asyncBytesToWrite = numBytesLeft; this.encryptedAppBuffer.flip(); tcp.setBuffer(this.encryptedAppBuffer); vc = tcp.write(TCPWriteRequestContext.WRITE_ALL_DATA, this, forceQueue, timeout); } } while (null != vc && 0 < numBytesLeft && 0 < produced); } catch (IOException exception) { // No FFDC needed. Callback will handle. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Caught exception during encryption, " + exception); } this.callback.error(getConnLink().getVirtualConnection(), this, exception); } catch (Exception original) { synchronized (closeSync) { // if close has been called then assume this exception was due to a race condition // with the close logic. so no FFDC here. if (closeCalled) { return null; } else { throw original; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "encryptAndWriteAsync: " + vc); } return vc; }
[ "public", "VirtualConnection", "encryptAndWriteAsync", "(", "long", "numBytes", ",", "boolean", "forceQueue", ",", "int", "timeout", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "tc", ",", "\"encryptAndWriteAsync: \"", "+", "numBytes", ")", ";", "}", "this", ".", "asyncBytesToWrite", "=", "0L", ";", "this", ".", "asyncTimeout", "=", "timeout", ";", "VirtualConnection", "vc", "=", "null", ";", "try", "{", "long", "numBytesLeft", "=", "numBytes", ";", "// make sure we have an output buffer of the target size ready", "final", "int", "packetSize", "=", "getConnLink", "(", ")", ".", "getPacketBufferSize", "(", ")", ";", "if", "(", "numBytesLeft", ">", "packetSize", ")", "{", "getEncryptedAppBuffer", "(", "packetSize", "*", "2", ")", ";", "}", "else", "{", "getEncryptedAppBuffer", "(", "1", ")", ";", "}", "final", "int", "cap", "=", "this", ".", "encryptedAppBuffer", ".", "capacity", "(", ")", ";", "final", "TCPWriteRequestContext", "tcp", "=", "getConnLink", "(", ")", ".", "getDeviceWriteInterface", "(", ")", ";", "SSLEngineResult", "result", ";", "int", "produced", ";", "do", "{", "this", ".", "encryptedAppBuffer", ".", "clear", "(", ")", ";", "result", "=", "encryptMessage", "(", ")", ";", "numBytesLeft", "-=", "result", ".", "bytesConsumed", "(", ")", ";", "produced", "=", "result", ".", "bytesProduced", "(", ")", ";", "if", "(", "0", "<", "produced", ")", "{", "while", "(", "0", "<", "numBytesLeft", "&&", "(", "cap", "-", "produced", ")", ">=", "packetSize", ")", "{", "// space in the current output buffer to encrypt a little more", "// Note: JSSE requires a full packet size of open space regardless of the input", "// amount, so even 100 bytes to encrypt requires 16K of output space", "result", "=", "encryptMessage", "(", ")", ";", "numBytesLeft", "-=", "result", ".", "bytesConsumed", "(", ")", ";", "produced", "+=", "result", ".", "bytesProduced", "(", ")", ";", "}", "// in case this goes async, save bytes-left to pick up later", "this", ".", "asyncBytesToWrite", "=", "numBytesLeft", ";", "this", ".", "encryptedAppBuffer", ".", "flip", "(", ")", ";", "tcp", ".", "setBuffer", "(", "this", ".", "encryptedAppBuffer", ")", ";", "vc", "=", "tcp", ".", "write", "(", "TCPWriteRequestContext", ".", "WRITE_ALL_DATA", ",", "this", ",", "forceQueue", ",", "timeout", ")", ";", "}", "}", "while", "(", "null", "!=", "vc", "&&", "0", "<", "numBytesLeft", "&&", "0", "<", "produced", ")", ";", "}", "catch", "(", "IOException", "exception", ")", "{", "// No FFDC needed. Callback will handle.", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Caught exception during encryption, \"", "+", "exception", ")", ";", "}", "this", ".", "callback", ".", "error", "(", "getConnLink", "(", ")", ".", "getVirtualConnection", "(", ")", ",", "this", ",", "exception", ")", ";", "}", "catch", "(", "Exception", "original", ")", "{", "synchronized", "(", "closeSync", ")", "{", "// if close has been called then assume this exception was due to a race condition", "// with the close logic. so no FFDC here.", "if", "(", "closeCalled", ")", "{", "return", "null", ";", "}", "else", "{", "throw", "original", ";", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "tc", ",", "\"encryptAndWriteAsync: \"", "+", "vc", ")", ";", "}", "return", "vc", ";", "}" ]
This method is called as a part of an asynchronous write, but after a potential SSL handshake has taken place. @param numBytes @param forceQueue @param timeout @return virtual connection
[ "This", "method", "is", "called", "as", "a", "part", "of", "an", "asynchronous", "write", "but", "after", "a", "potential", "SSL", "handshake", "has", "taken", "place", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java#L442-L511
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java
SSLWriteServiceContext.doHandshake
private SSLEngineResult doHandshake(MyHandshakeCompletedCallback hsCallback) throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "doHandshake"); } SSLEngineResult sslResult; SSLEngine sslEngine = getConnLink().getSSLEngine(); // Line up all the buffers needed for the SSL handshake. Temporary so use // indirect allocation for speed. WsByteBuffer netBuffer = SSLUtils.allocateByteBuffer( sslEngine.getSession().getPacketBufferSize(), true); WsByteBuffer decryptedNetBuffer = SSLUtils.allocateByteBuffer( sslEngine.getSession().getApplicationBufferSize(), false); try { getEncryptedAppBuffer(1); } catch (IOException up) { // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); throw up; } if (hsCallback != null) { // If the callback is non null, update the callback with the buffers it // will have to release. hsCallback.setNetBuffer(netBuffer); hsCallback.setDecryptedNetBuffer(decryptedNetBuffer); } try { // Do the SSL handshake. Note, if synchronous the handshakeCallback is null. sslResult = SSLUtils.handleHandshake( getConnLink(), netBuffer, decryptedNetBuffer, this.encryptedAppBuffer, null, hsCallback, false); } catch (IOException e) { // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); throw e; } catch (ReadOnlyBufferException robe) { // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); throw new IOException("Caught exception during handshake: " + robe.getMessage(), robe); } if (sslResult != null) { // Handshake was done synchronously. // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "doHandshake: " + sslResult); } return sslResult; }
java
private SSLEngineResult doHandshake(MyHandshakeCompletedCallback hsCallback) throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "doHandshake"); } SSLEngineResult sslResult; SSLEngine sslEngine = getConnLink().getSSLEngine(); // Line up all the buffers needed for the SSL handshake. Temporary so use // indirect allocation for speed. WsByteBuffer netBuffer = SSLUtils.allocateByteBuffer( sslEngine.getSession().getPacketBufferSize(), true); WsByteBuffer decryptedNetBuffer = SSLUtils.allocateByteBuffer( sslEngine.getSession().getApplicationBufferSize(), false); try { getEncryptedAppBuffer(1); } catch (IOException up) { // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); throw up; } if (hsCallback != null) { // If the callback is non null, update the callback with the buffers it // will have to release. hsCallback.setNetBuffer(netBuffer); hsCallback.setDecryptedNetBuffer(decryptedNetBuffer); } try { // Do the SSL handshake. Note, if synchronous the handshakeCallback is null. sslResult = SSLUtils.handleHandshake( getConnLink(), netBuffer, decryptedNetBuffer, this.encryptedAppBuffer, null, hsCallback, false); } catch (IOException e) { // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); throw e; } catch (ReadOnlyBufferException robe) { // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); throw new IOException("Caught exception during handshake: " + robe.getMessage(), robe); } if (sslResult != null) { // Handshake was done synchronously. // Release buffers used in the handshake. netBuffer.release(); decryptedNetBuffer.release(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "doHandshake: " + sslResult); } return sslResult; }
[ "private", "SSLEngineResult", "doHandshake", "(", "MyHandshakeCompletedCallback", "hsCallback", ")", "throws", "IOException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "tc", ",", "\"doHandshake\"", ")", ";", "}", "SSLEngineResult", "sslResult", ";", "SSLEngine", "sslEngine", "=", "getConnLink", "(", ")", ".", "getSSLEngine", "(", ")", ";", "// Line up all the buffers needed for the SSL handshake. Temporary so use", "// indirect allocation for speed.", "WsByteBuffer", "netBuffer", "=", "SSLUtils", ".", "allocateByteBuffer", "(", "sslEngine", ".", "getSession", "(", ")", ".", "getPacketBufferSize", "(", ")", ",", "true", ")", ";", "WsByteBuffer", "decryptedNetBuffer", "=", "SSLUtils", ".", "allocateByteBuffer", "(", "sslEngine", ".", "getSession", "(", ")", ".", "getApplicationBufferSize", "(", ")", ",", "false", ")", ";", "try", "{", "getEncryptedAppBuffer", "(", "1", ")", ";", "}", "catch", "(", "IOException", "up", ")", "{", "// Release buffers used in the handshake.", "netBuffer", ".", "release", "(", ")", ";", "decryptedNetBuffer", ".", "release", "(", ")", ";", "throw", "up", ";", "}", "if", "(", "hsCallback", "!=", "null", ")", "{", "// If the callback is non null, update the callback with the buffers it", "// will have to release.", "hsCallback", ".", "setNetBuffer", "(", "netBuffer", ")", ";", "hsCallback", ".", "setDecryptedNetBuffer", "(", "decryptedNetBuffer", ")", ";", "}", "try", "{", "// Do the SSL handshake. Note, if synchronous the handshakeCallback is null.", "sslResult", "=", "SSLUtils", ".", "handleHandshake", "(", "getConnLink", "(", ")", ",", "netBuffer", ",", "decryptedNetBuffer", ",", "this", ".", "encryptedAppBuffer", ",", "null", ",", "hsCallback", ",", "false", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "// Release buffers used in the handshake.", "netBuffer", ".", "release", "(", ")", ";", "decryptedNetBuffer", ".", "release", "(", ")", ";", "throw", "e", ";", "}", "catch", "(", "ReadOnlyBufferException", "robe", ")", "{", "// Release buffers used in the handshake.", "netBuffer", ".", "release", "(", ")", ";", "decryptedNetBuffer", ".", "release", "(", ")", ";", "throw", "new", "IOException", "(", "\"Caught exception during handshake: \"", "+", "robe", ".", "getMessage", "(", ")", ",", "robe", ")", ";", "}", "if", "(", "sslResult", "!=", "null", ")", "{", "// Handshake was done synchronously.", "// Release buffers used in the handshake.", "netBuffer", ".", "release", "(", ")", ";", "decryptedNetBuffer", ".", "release", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "tc", ",", "\"doHandshake: \"", "+", "sslResult", ")", ";", "}", "return", "sslResult", ";", "}" ]
When a write is attempted, a first check is done to see if the SSL engine needs to do a handshake. If so, this method will be called. Note, it is used by both the sync and async writes. @param hsCallback callback for use by async write, null for sync write @return result of the handshake @throws IOException
[ "When", "a", "write", "is", "attempted", "a", "first", "check", "is", "done", "to", "see", "if", "the", "SSL", "engine", "needs", "to", "do", "a", "handshake", ".", "If", "so", "this", "method", "will", "be", "called", ".", "Note", "it", "is", "used", "by", "both", "the", "sync", "and", "async", "writes", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java#L619-L678
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java
SSLWriteServiceContext.encryptMessage
private SSLEngineResult encryptMessage() throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "encryptMessage"); } // Get the application buffer used as input to the encryption algorithm. // Extract the app buffers containing data to be written. final WsByteBuffer[] appBuffers = getBuffers(); SSLEngineResult result; while (true) { // Protect JSSE from potential SSL packet sizes that are too big. int[] appLimitInfo = SSLUtils.adjustBuffersForJSSE( appBuffers, getConnLink().getAppBufferSize()); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "before wrap: appBuffers: " + SSLUtils.getBufferTraceInfo(appBuffers) + "\r\n\tencAppBuf: " + SSLUtils.getBufferTraceInfo(encryptedAppBuffer)); } // Call the SSL engine to encrypt the request. result = getConnLink().getSSLEngine().wrap( SSLUtils.getWrappedByteBuffers(appBuffers), encryptedAppBuffer.getWrappedByteBuffer()); // Check the result of the call to wrap. Status status = result.getStatus(); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "after wrap: appBuffers: " + SSLUtils.getBufferTraceInfo(appBuffers) + "\r\n\tencAppBuf: " + SSLUtils.getBufferTraceInfo(encryptedAppBuffer) + "\r\n\tstatus=" + status + " consumed=" + result.bytesConsumed() + " produced=" + result.bytesProduced()); } // If a limit modification was saved, restore it. if (appLimitInfo != null) { SSLUtils.resetBuffersAfterJSSE(appBuffers, appLimitInfo); } if (status == Status.OK) { break; } else if (status == Status.BUFFER_OVERFLOW) { // The output buffers provided to the SSL engine were not big enough. A bigger buffer // must be supplied. If we can build a bigger buffer and call again, build it. increaseEncryptedBuffer(); continue; } else { throw new IOException("Unable to encrypt data, status=" + status); } } // end of while if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "encryptMessage: " + result.getStatus()); } return result; }
java
private SSLEngineResult encryptMessage() throws IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "encryptMessage"); } // Get the application buffer used as input to the encryption algorithm. // Extract the app buffers containing data to be written. final WsByteBuffer[] appBuffers = getBuffers(); SSLEngineResult result; while (true) { // Protect JSSE from potential SSL packet sizes that are too big. int[] appLimitInfo = SSLUtils.adjustBuffersForJSSE( appBuffers, getConnLink().getAppBufferSize()); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "before wrap: appBuffers: " + SSLUtils.getBufferTraceInfo(appBuffers) + "\r\n\tencAppBuf: " + SSLUtils.getBufferTraceInfo(encryptedAppBuffer)); } // Call the SSL engine to encrypt the request. result = getConnLink().getSSLEngine().wrap( SSLUtils.getWrappedByteBuffers(appBuffers), encryptedAppBuffer.getWrappedByteBuffer()); // Check the result of the call to wrap. Status status = result.getStatus(); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "after wrap: appBuffers: " + SSLUtils.getBufferTraceInfo(appBuffers) + "\r\n\tencAppBuf: " + SSLUtils.getBufferTraceInfo(encryptedAppBuffer) + "\r\n\tstatus=" + status + " consumed=" + result.bytesConsumed() + " produced=" + result.bytesProduced()); } // If a limit modification was saved, restore it. if (appLimitInfo != null) { SSLUtils.resetBuffersAfterJSSE(appBuffers, appLimitInfo); } if (status == Status.OK) { break; } else if (status == Status.BUFFER_OVERFLOW) { // The output buffers provided to the SSL engine were not big enough. A bigger buffer // must be supplied. If we can build a bigger buffer and call again, build it. increaseEncryptedBuffer(); continue; } else { throw new IOException("Unable to encrypt data, status=" + status); } } // end of while if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "encryptMessage: " + result.getStatus()); } return result; }
[ "private", "SSLEngineResult", "encryptMessage", "(", ")", "throws", "IOException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "tc", ",", "\"encryptMessage\"", ")", ";", "}", "// Get the application buffer used as input to the encryption algorithm.", "// Extract the app buffers containing data to be written.", "final", "WsByteBuffer", "[", "]", "appBuffers", "=", "getBuffers", "(", ")", ";", "SSLEngineResult", "result", ";", "while", "(", "true", ")", "{", "// Protect JSSE from potential SSL packet sizes that are too big.", "int", "[", "]", "appLimitInfo", "=", "SSLUtils", ".", "adjustBuffersForJSSE", "(", "appBuffers", ",", "getConnLink", "(", ")", ".", "getAppBufferSize", "(", ")", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"before wrap: appBuffers: \"", "+", "SSLUtils", ".", "getBufferTraceInfo", "(", "appBuffers", ")", "+", "\"\\r\\n\\tencAppBuf: \"", "+", "SSLUtils", ".", "getBufferTraceInfo", "(", "encryptedAppBuffer", ")", ")", ";", "}", "// Call the SSL engine to encrypt the request.", "result", "=", "getConnLink", "(", ")", ".", "getSSLEngine", "(", ")", ".", "wrap", "(", "SSLUtils", ".", "getWrappedByteBuffers", "(", "appBuffers", ")", ",", "encryptedAppBuffer", ".", "getWrappedByteBuffer", "(", ")", ")", ";", "// Check the result of the call to wrap.", "Status", "status", "=", "result", ".", "getStatus", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"after wrap: appBuffers: \"", "+", "SSLUtils", ".", "getBufferTraceInfo", "(", "appBuffers", ")", "+", "\"\\r\\n\\tencAppBuf: \"", "+", "SSLUtils", ".", "getBufferTraceInfo", "(", "encryptedAppBuffer", ")", "+", "\"\\r\\n\\tstatus=\"", "+", "status", "+", "\" consumed=\"", "+", "result", ".", "bytesConsumed", "(", ")", "+", "\" produced=\"", "+", "result", ".", "bytesProduced", "(", ")", ")", ";", "}", "// If a limit modification was saved, restore it.", "if", "(", "appLimitInfo", "!=", "null", ")", "{", "SSLUtils", ".", "resetBuffersAfterJSSE", "(", "appBuffers", ",", "appLimitInfo", ")", ";", "}", "if", "(", "status", "==", "Status", ".", "OK", ")", "{", "break", ";", "}", "else", "if", "(", "status", "==", "Status", ".", "BUFFER_OVERFLOW", ")", "{", "// The output buffers provided to the SSL engine were not big enough. A bigger buffer", "// must be supplied. If we can build a bigger buffer and call again, build it.", "increaseEncryptedBuffer", "(", ")", ";", "continue", ";", "}", "else", "{", "throw", "new", "IOException", "(", "\"Unable to encrypt data, status=\"", "+", "status", ")", ";", "}", "}", "// end of while", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "tc", ",", "\"encryptMessage: \"", "+", "result", ".", "getStatus", "(", ")", ")", ";", "}", "return", "result", ";", "}" ]
Handle common activity of write and writeAsynch involving the encryption of the current buffers. The caller will have the responsibility of writing them to the device side channel. @return SSLEngineResult @throws IOException
[ "Handle", "common", "activity", "of", "write", "and", "writeAsynch", "involving", "the", "encryption", "of", "the", "current", "buffers", ".", "The", "caller", "will", "have", "the", "responsibility", "of", "writing", "them", "to", "the", "device", "side", "channel", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java#L688-L750
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java
SSLWriteServiceContext.increaseEncryptedBuffer
protected void increaseEncryptedBuffer() throws IOException { final int packetSize = getConnLink().getPacketBufferSize(); if (null == this.encryptedAppBuffer) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Allocating encryptedAppBuffer, size=" + packetSize); } this.encryptedAppBuffer = SSLUtils.allocateByteBuffer( packetSize, getConfig().getEncryptBuffersDirect()); } else { // The existing buffer isn't big enough, add another packet size to it final int cap = this.encryptedAppBuffer.capacity(); final int newsize = cap + packetSize; if (0 > newsize) { // wrapped over max-int if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Unable to increase encrypted buffer beyond " + cap); } throw new IOException("Unable to increase buffer beyond " + cap); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Increasing encryptedAppBuffer to " + newsize); } WsByteBuffer temp = SSLUtils.allocateByteBuffer( newsize, this.encryptedAppBuffer.isDirect()); this.encryptedAppBuffer.flip(); SSLUtils.copyBuffer(this.encryptedAppBuffer, temp, this.encryptedAppBuffer.remaining()); this.encryptedAppBuffer.release(); this.encryptedAppBuffer = temp; } }
java
protected void increaseEncryptedBuffer() throws IOException { final int packetSize = getConnLink().getPacketBufferSize(); if (null == this.encryptedAppBuffer) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Allocating encryptedAppBuffer, size=" + packetSize); } this.encryptedAppBuffer = SSLUtils.allocateByteBuffer( packetSize, getConfig().getEncryptBuffersDirect()); } else { // The existing buffer isn't big enough, add another packet size to it final int cap = this.encryptedAppBuffer.capacity(); final int newsize = cap + packetSize; if (0 > newsize) { // wrapped over max-int if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Unable to increase encrypted buffer beyond " + cap); } throw new IOException("Unable to increase buffer beyond " + cap); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Increasing encryptedAppBuffer to " + newsize); } WsByteBuffer temp = SSLUtils.allocateByteBuffer( newsize, this.encryptedAppBuffer.isDirect()); this.encryptedAppBuffer.flip(); SSLUtils.copyBuffer(this.encryptedAppBuffer, temp, this.encryptedAppBuffer.remaining()); this.encryptedAppBuffer.release(); this.encryptedAppBuffer = temp; } }
[ "protected", "void", "increaseEncryptedBuffer", "(", ")", "throws", "IOException", "{", "final", "int", "packetSize", "=", "getConnLink", "(", ")", ".", "getPacketBufferSize", "(", ")", ";", "if", "(", "null", "==", "this", ".", "encryptedAppBuffer", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Allocating encryptedAppBuffer, size=\"", "+", "packetSize", ")", ";", "}", "this", ".", "encryptedAppBuffer", "=", "SSLUtils", ".", "allocateByteBuffer", "(", "packetSize", ",", "getConfig", "(", ")", ".", "getEncryptBuffersDirect", "(", ")", ")", ";", "}", "else", "{", "// The existing buffer isn't big enough, add another packet size to it", "final", "int", "cap", "=", "this", ".", "encryptedAppBuffer", ".", "capacity", "(", ")", ";", "final", "int", "newsize", "=", "cap", "+", "packetSize", ";", "if", "(", "0", ">", "newsize", ")", "{", "// wrapped over max-int", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Unable to increase encrypted buffer beyond \"", "+", "cap", ")", ";", "}", "throw", "new", "IOException", "(", "\"Unable to increase buffer beyond \"", "+", "cap", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Increasing encryptedAppBuffer to \"", "+", "newsize", ")", ";", "}", "WsByteBuffer", "temp", "=", "SSLUtils", ".", "allocateByteBuffer", "(", "newsize", ",", "this", ".", "encryptedAppBuffer", ".", "isDirect", "(", ")", ")", ";", "this", ".", "encryptedAppBuffer", ".", "flip", "(", ")", ";", "SSLUtils", ".", "copyBuffer", "(", "this", ".", "encryptedAppBuffer", ",", "temp", ",", "this", ".", "encryptedAppBuffer", ".", "remaining", "(", ")", ")", ";", "this", ".", "encryptedAppBuffer", ".", "release", "(", ")", ";", "this", ".", "encryptedAppBuffer", "=", "temp", ";", "}", "}" ]
Reuse the buffers used to send data out to the network. If existing buffer is available, grow the array by one. @throws IOException - if allocation failed
[ "Reuse", "the", "buffers", "used", "to", "send", "data", "out", "to", "the", "network", ".", "If", "existing", "buffer", "is", "available", "grow", "the", "array", "by", "one", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java#L758-L787
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java
SSLWriteServiceContext.getEncryptedAppBuffer
private void getEncryptedAppBuffer(int requested_size) throws IOException { final int size = Math.max(getConnLink().getPacketBufferSize(), requested_size); synchronized (closeSync) { if (closeCalled) { IOException up = new IOException("Operation failed due to connection close detected"); throw up; } if (null != this.encryptedAppBuffer) { if (size <= this.encryptedAppBuffer.capacity()) { // current buffer exists and is big enough this.encryptedAppBuffer.clear(); return; } // exists but is too small this.encryptedAppBuffer.release(); this.encryptedAppBuffer = null; } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Allocating encryptedAppBuffer, size=" + size); } // Allocate the encrypted data buffer this.encryptedAppBuffer = SSLUtils.allocateByteBuffer( size, getConfig().getEncryptBuffersDirect()); } }
java
private void getEncryptedAppBuffer(int requested_size) throws IOException { final int size = Math.max(getConnLink().getPacketBufferSize(), requested_size); synchronized (closeSync) { if (closeCalled) { IOException up = new IOException("Operation failed due to connection close detected"); throw up; } if (null != this.encryptedAppBuffer) { if (size <= this.encryptedAppBuffer.capacity()) { // current buffer exists and is big enough this.encryptedAppBuffer.clear(); return; } // exists but is too small this.encryptedAppBuffer.release(); this.encryptedAppBuffer = null; } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Allocating encryptedAppBuffer, size=" + size); } // Allocate the encrypted data buffer this.encryptedAppBuffer = SSLUtils.allocateByteBuffer( size, getConfig().getEncryptBuffersDirect()); } }
[ "private", "void", "getEncryptedAppBuffer", "(", "int", "requested_size", ")", "throws", "IOException", "{", "final", "int", "size", "=", "Math", ".", "max", "(", "getConnLink", "(", ")", ".", "getPacketBufferSize", "(", ")", ",", "requested_size", ")", ";", "synchronized", "(", "closeSync", ")", "{", "if", "(", "closeCalled", ")", "{", "IOException", "up", "=", "new", "IOException", "(", "\"Operation failed due to connection close detected\"", ")", ";", "throw", "up", ";", "}", "if", "(", "null", "!=", "this", ".", "encryptedAppBuffer", ")", "{", "if", "(", "size", "<=", "this", ".", "encryptedAppBuffer", ".", "capacity", "(", ")", ")", "{", "// current buffer exists and is big enough", "this", ".", "encryptedAppBuffer", ".", "clear", "(", ")", ";", "return", ";", "}", "// exists but is too small", "this", ".", "encryptedAppBuffer", ".", "release", "(", ")", ";", "this", ".", "encryptedAppBuffer", "=", "null", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Allocating encryptedAppBuffer, size=\"", "+", "size", ")", ";", "}", "// Allocate the encrypted data buffer", "this", ".", "encryptedAppBuffer", "=", "SSLUtils", ".", "allocateByteBuffer", "(", "size", ",", "getConfig", "(", ")", ".", "getEncryptBuffersDirect", "(", ")", ")", ";", "}", "}" ]
Make sure that an output buffer is ready for encryption use. This will always allocate a minimum of the current SSLSession packet size. @param requested_size
[ "Make", "sure", "that", "an", "output", "buffer", "is", "ready", "for", "encryption", "use", ".", "This", "will", "always", "allocate", "a", "minimum", "of", "the", "current", "SSLSession", "packet", "size", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java#L795-L822
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java
SSLWriteServiceContext.close
public void close() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "close"); } synchronized (closeSync) { if (closeCalled) { return; } closeCalled = true; // Release the buffer used to store results of encryption, and given to // device channel for writing. if (null != this.encryptedAppBuffer) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Releasing ssl output buffer during close. " + SSLUtils.getBufferTraceInfo(this.encryptedAppBuffer)); } this.encryptedAppBuffer.release(); this.encryptedAppBuffer = null; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "close"); } }
java
public void close() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "close"); } synchronized (closeSync) { if (closeCalled) { return; } closeCalled = true; // Release the buffer used to store results of encryption, and given to // device channel for writing. if (null != this.encryptedAppBuffer) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Releasing ssl output buffer during close. " + SSLUtils.getBufferTraceInfo(this.encryptedAppBuffer)); } this.encryptedAppBuffer.release(); this.encryptedAppBuffer = null; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "close"); } }
[ "public", "void", "close", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "tc", ",", "\"close\"", ")", ";", "}", "synchronized", "(", "closeSync", ")", "{", "if", "(", "closeCalled", ")", "{", "return", ";", "}", "closeCalled", "=", "true", ";", "// Release the buffer used to store results of encryption, and given to", "// device channel for writing.", "if", "(", "null", "!=", "this", ".", "encryptedAppBuffer", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Releasing ssl output buffer during close. \"", "+", "SSLUtils", ".", "getBufferTraceInfo", "(", "this", ".", "encryptedAppBuffer", ")", ")", ";", "}", "this", ".", "encryptedAppBuffer", ".", "release", "(", ")", ";", "this", ".", "encryptedAppBuffer", "=", "null", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "tc", ",", "\"close\"", ")", ";", "}", "}" ]
Release the potential input buffer that was created during encryption.
[ "Release", "the", "potential", "input", "buffer", "that", "was", "created", "during", "encryption", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLWriteServiceContext.java#L827-L854
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/SubjectPublicKeyInfo.java
SubjectPublicKeyInfo.getPublicKey
public DERObject getPublicKey() throws IOException { ByteArrayInputStream bIn = new ByteArrayInputStream(keyData.getBytes()); ASN1InputStream aIn = new ASN1InputStream(bIn); return aIn.readObject(); }
java
public DERObject getPublicKey() throws IOException { ByteArrayInputStream bIn = new ByteArrayInputStream(keyData.getBytes()); ASN1InputStream aIn = new ASN1InputStream(bIn); return aIn.readObject(); }
[ "public", "DERObject", "getPublicKey", "(", ")", "throws", "IOException", "{", "ByteArrayInputStream", "bIn", "=", "new", "ByteArrayInputStream", "(", "keyData", ".", "getBytes", "(", ")", ")", ";", "ASN1InputStream", "aIn", "=", "new", "ASN1InputStream", "(", "bIn", ")", ";", "return", "aIn", ".", "readObject", "(", ")", ";", "}" ]
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException. @exception IOException - if the bit string doesn't represent a DER encoded object.
[ "for", "when", "the", "public", "key", "is", "an", "encoded", "object", "-", "if", "the", "bitstring", "can", "t", "be", "decoded", "this", "routine", "throws", "an", "IOException", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/SubjectPublicKeyInfo.java#L102-L109
train
OpenLiberty/open-liberty
dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/remap/AddVersionFieldClassAdapter.java
AddVersionFieldClassAdapter.visitEnd
@Override public void visitEnd() { if (!fieldAlreadyExists) { FieldVisitor fv = super.visitField( Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_STATIC, versionFieldName, Type.getDescriptor(String.class), null, versionFieldValue); fv.visitEnd(); } super.visitEnd(); }
java
@Override public void visitEnd() { if (!fieldAlreadyExists) { FieldVisitor fv = super.visitField( Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_STATIC, versionFieldName, Type.getDescriptor(String.class), null, versionFieldValue); fv.visitEnd(); } super.visitEnd(); }
[ "@", "Override", "public", "void", "visitEnd", "(", ")", "{", "if", "(", "!", "fieldAlreadyExists", ")", "{", "FieldVisitor", "fv", "=", "super", ".", "visitField", "(", "Opcodes", ".", "ACC_PUBLIC", "+", "Opcodes", ".", "ACC_FINAL", "+", "Opcodes", ".", "ACC_STATIC", ",", "versionFieldName", ",", "Type", ".", "getDescriptor", "(", "String", ".", "class", ")", ",", "null", ",", "versionFieldValue", ")", ";", "fv", ".", "visitEnd", "(", ")", ";", "}", "super", ".", "visitEnd", "(", ")", ";", "}" ]
End of class visitor that creates a version field definition if an existing definition wasn't observed.
[ "End", "of", "class", "visitor", "that", "creates", "a", "version", "field", "definition", "if", "an", "existing", "definition", "wasn", "t", "observed", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/remap/AddVersionFieldClassAdapter.java#L72-L85
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setNonPersistentMapping
@Override public void setNonPersistentMapping(String nonPersistentMapping) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setNonPersistentMapping", nonPersistentMapping); if (nonPersistentMapping == null) { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "nonPersistentMapping", null }, tc ); } if (nonPersistentMapping.equals(ApiJmsConstants.MAPPING_BEST_EFFORT_NONPERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_EXPRESS_NONPERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_NONPERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_PERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_ASSURED_PERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_NONE)) { jcaManagedConnectionFactory.setNonPersistentMapping(nonPersistentMapping); } else if (nonPersistentMapping.equals(ApiJmsConstants.MAPPING_AS_SIB_DESTINATION)) { jcaManagedConnectionFactory.setNonPersistentMapping(ApiJmsConstants.MAPPING_NONE); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "nonPersistentMapping", nonPersistentMapping }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setNonPersistentMapping"); }
java
@Override public void setNonPersistentMapping(String nonPersistentMapping) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setNonPersistentMapping", nonPersistentMapping); if (nonPersistentMapping == null) { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "nonPersistentMapping", null }, tc ); } if (nonPersistentMapping.equals(ApiJmsConstants.MAPPING_BEST_EFFORT_NONPERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_EXPRESS_NONPERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_NONPERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_PERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_ASSURED_PERSISTENT) || nonPersistentMapping.equals(ApiJmsConstants.MAPPING_NONE)) { jcaManagedConnectionFactory.setNonPersistentMapping(nonPersistentMapping); } else if (nonPersistentMapping.equals(ApiJmsConstants.MAPPING_AS_SIB_DESTINATION)) { jcaManagedConnectionFactory.setNonPersistentMapping(ApiJmsConstants.MAPPING_NONE); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "nonPersistentMapping", nonPersistentMapping }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setNonPersistentMapping"); }
[ "@", "Override", "public", "void", "setNonPersistentMapping", "(", "String", "nonPersistentMapping", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setNonPersistentMapping\"", ",", "nonPersistentMapping", ")", ";", "if", "(", "nonPersistentMapping", "==", "null", ")", "{", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"nonPersistentMapping\"", ",", "null", "}", ",", "tc", ")", ";", "}", "if", "(", "nonPersistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_BEST_EFFORT_NONPERSISTENT", ")", "||", "nonPersistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_EXPRESS_NONPERSISTENT", ")", "||", "nonPersistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_RELIABLE_NONPERSISTENT", ")", "||", "nonPersistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_RELIABLE_PERSISTENT", ")", "||", "nonPersistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_ASSURED_PERSISTENT", ")", "||", "nonPersistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_NONE", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setNonPersistentMapping", "(", "nonPersistentMapping", ")", ";", "}", "else", "if", "(", "nonPersistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_AS_SIB_DESTINATION", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setNonPersistentMapping", "(", "ApiJmsConstants", ".", "MAPPING_NONE", ")", ";", "}", "else", "{", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"nonPersistentMapping\"", ",", "nonPersistentMapping", "}", ",", "tc", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setNonPersistentMapping\"", ")", ";", "}" ]
default non persistent mapping is EXPRESS_NONPERSISTENT, null non persistent mapping is not valid.
[ "default", "non", "persistent", "mapping", "is", "EXPRESS_NONPERSISTENT", "null", "non", "persistent", "mapping", "is", "not", "valid", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L117-L153
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setPersistentMapping
@Override public void setPersistentMapping(String persistentMapping) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setPersistentMapping", persistentMapping); if (persistentMapping == null) { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "persistentMapping", null }, tc ); } if (persistentMapping.equals(ApiJmsConstants.MAPPING_BEST_EFFORT_NONPERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_EXPRESS_NONPERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_NONPERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_PERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_ASSURED_PERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_NONE)) { jcaManagedConnectionFactory.setPersistentMapping(persistentMapping); } else if (persistentMapping.equals(ApiJmsConstants.MAPPING_AS_SIB_DESTINATION)) { jcaManagedConnectionFactory.setPersistentMapping(ApiJmsConstants.MAPPING_NONE); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "persistentMapping", persistentMapping }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setPersistentMapping"); }
java
@Override public void setPersistentMapping(String persistentMapping) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setPersistentMapping", persistentMapping); if (persistentMapping == null) { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "persistentMapping", null }, tc ); } if (persistentMapping.equals(ApiJmsConstants.MAPPING_BEST_EFFORT_NONPERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_EXPRESS_NONPERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_NONPERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_RELIABLE_PERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_ASSURED_PERSISTENT) || persistentMapping.equals(ApiJmsConstants.MAPPING_NONE)) { jcaManagedConnectionFactory.setPersistentMapping(persistentMapping); } else if (persistentMapping.equals(ApiJmsConstants.MAPPING_AS_SIB_DESTINATION)) { jcaManagedConnectionFactory.setPersistentMapping(ApiJmsConstants.MAPPING_NONE); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "persistentMapping", persistentMapping }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setPersistentMapping"); }
[ "@", "Override", "public", "void", "setPersistentMapping", "(", "String", "persistentMapping", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setPersistentMapping\"", ",", "persistentMapping", ")", ";", "if", "(", "persistentMapping", "==", "null", ")", "{", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"persistentMapping\"", ",", "null", "}", ",", "tc", ")", ";", "}", "if", "(", "persistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_BEST_EFFORT_NONPERSISTENT", ")", "||", "persistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_EXPRESS_NONPERSISTENT", ")", "||", "persistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_RELIABLE_NONPERSISTENT", ")", "||", "persistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_RELIABLE_PERSISTENT", ")", "||", "persistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_ASSURED_PERSISTENT", ")", "||", "persistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_NONE", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setPersistentMapping", "(", "persistentMapping", ")", ";", "}", "else", "if", "(", "persistentMapping", ".", "equals", "(", "ApiJmsConstants", ".", "MAPPING_AS_SIB_DESTINATION", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setPersistentMapping", "(", "ApiJmsConstants", ".", "MAPPING_NONE", ")", ";", "}", "else", "{", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"persistentMapping\"", ",", "persistentMapping", "}", ",", "tc", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setPersistentMapping\"", ")", ";", "}" ]
default persistent mapping is RELIABLE_PERSISTENT, null persistent mapping is not valid.
[ "default", "persistent", "mapping", "is", "RELIABLE_PERSISTENT", "null", "persistent", "mapping", "is", "not", "valid", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L159-L195
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setConnectionProximity
@Override public void setConnectionProximity(String newConnectionProximity) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setConnectionProximity", newConnectionProximity); // Check for null and empty string, and set to default value if found if ((newConnectionProximity == null) || ("".equals(newConnectionProximity))) { jcaManagedConnectionFactory.setConnectionProximity(ApiJmsConstants.CONNECTION_PROXIMITY_BUS); } //ensure that the value is one of the permitted constants - if not throw an exception else if ((ApiJmsConstants.CONNECTION_PROXIMITY_BUS.equals(newConnectionProximity)) || (ApiJmsConstants.CONNECTION_PROXIMITY_HOST.equals(newConnectionProximity)) || (ApiJmsConstants.CONNECTION_PROXIMITY_CLUSTER.equals(newConnectionProximity)) || (ApiJmsConstants.CONNECTION_PROXIMITY_SERVER.equals(newConnectionProximity))) { jcaManagedConnectionFactory.setConnectionProximity(newConnectionProximity); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "connectionProximity", newConnectionProximity }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setConnectionProximity"); }
java
@Override public void setConnectionProximity(String newConnectionProximity) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setConnectionProximity", newConnectionProximity); // Check for null and empty string, and set to default value if found if ((newConnectionProximity == null) || ("".equals(newConnectionProximity))) { jcaManagedConnectionFactory.setConnectionProximity(ApiJmsConstants.CONNECTION_PROXIMITY_BUS); } //ensure that the value is one of the permitted constants - if not throw an exception else if ((ApiJmsConstants.CONNECTION_PROXIMITY_BUS.equals(newConnectionProximity)) || (ApiJmsConstants.CONNECTION_PROXIMITY_HOST.equals(newConnectionProximity)) || (ApiJmsConstants.CONNECTION_PROXIMITY_CLUSTER.equals(newConnectionProximity)) || (ApiJmsConstants.CONNECTION_PROXIMITY_SERVER.equals(newConnectionProximity))) { jcaManagedConnectionFactory.setConnectionProximity(newConnectionProximity); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "connectionProximity", newConnectionProximity }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setConnectionProximity"); }
[ "@", "Override", "public", "void", "setConnectionProximity", "(", "String", "newConnectionProximity", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setConnectionProximity\"", ",", "newConnectionProximity", ")", ";", "// Check for null and empty string, and set to default value if found", "if", "(", "(", "newConnectionProximity", "==", "null", ")", "||", "(", "\"\"", ".", "equals", "(", "newConnectionProximity", ")", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setConnectionProximity", "(", "ApiJmsConstants", ".", "CONNECTION_PROXIMITY_BUS", ")", ";", "}", "//ensure that the value is one of the permitted constants - if not throw an exception", "else", "if", "(", "(", "ApiJmsConstants", ".", "CONNECTION_PROXIMITY_BUS", ".", "equals", "(", "newConnectionProximity", ")", ")", "||", "(", "ApiJmsConstants", ".", "CONNECTION_PROXIMITY_HOST", ".", "equals", "(", "newConnectionProximity", ")", ")", "||", "(", "ApiJmsConstants", ".", "CONNECTION_PROXIMITY_CLUSTER", ".", "equals", "(", "newConnectionProximity", ")", ")", "||", "(", "ApiJmsConstants", ".", "CONNECTION_PROXIMITY_SERVER", ".", "equals", "(", "newConnectionProximity", ")", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setConnectionProximity", "(", "newConnectionProximity", ")", ";", "}", "else", "{", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"connectionProximity\"", ",", "newConnectionProximity", "}", ",", "tc", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setConnectionProximity\"", ")", ";", "}" ]
Set the connection proximity 181802.2 @param newConnectionProximity The connection proximity to use @see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#setConnectionProximity(java.lang.String)
[ "Set", "the", "connection", "proximity", "181802", ".", "2" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L298-L325
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setTargetTransportChain
@Override public void setTargetTransportChain(String newTargetTransportChain) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTargetTransportChain", newTargetTransportChain); jcaManagedConnectionFactory.setTargetTransportChain(newTargetTransportChain); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTargetTransportChain"); }
java
@Override public void setTargetTransportChain(String newTargetTransportChain) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTargetTransportChain", newTargetTransportChain); jcaManagedConnectionFactory.setTargetTransportChain(newTargetTransportChain); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTargetTransportChain"); }
[ "@", "Override", "public", "void", "setTargetTransportChain", "(", "String", "newTargetTransportChain", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setTargetTransportChain\"", ",", "newTargetTransportChain", ")", ";", "jcaManagedConnectionFactory", ".", "setTargetTransportChain", "(", "newTargetTransportChain", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setTargetTransportChain\"", ")", ";", "}" ]
Set the remote protocol 181802.2 @param newTargetTransportChain The remote protocol to use @see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#setRemoteProtocol(java.lang.String)
[ "Set", "the", "remote", "protocol", "181802", ".", "2" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L368-L375
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setTarget
@Override public void setTarget(String newTargetGroup) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTarget", newTargetGroup); jcaManagedConnectionFactory.setTarget(newTargetGroup); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTarget"); }
java
@Override public void setTarget(String newTargetGroup) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTarget", newTargetGroup); jcaManagedConnectionFactory.setTarget(newTargetGroup); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTarget"); }
[ "@", "Override", "public", "void", "setTarget", "(", "String", "newTargetGroup", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setTarget\"", ",", "newTargetGroup", ")", ";", "jcaManagedConnectionFactory", ".", "setTarget", "(", "newTargetGroup", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setTarget\"", ")", ";", "}" ]
Set the target 181802.2 @param newTargetGroup The target to use @see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#setTarget(java.lang.String)
[ "Set", "the", "target", "181802", ".", "2" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L384-L391
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setTargetType
@Override public void setTargetType(String newTargetType) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTargetType", newTargetType); // Check for null and empty string, and set to default value if found if ((newTargetType == null) || ("".equals(newTargetType))) { jcaManagedConnectionFactory.setTargetType(ApiJmsConstants.TARGET_TYPE_BUSMEMBER); } // Ensure that the value is one of the permitted constants - thrown an exception if not else if ((ApiJmsConstants.TARGET_TYPE_BUSMEMBER.equals(newTargetType)) || (ApiJmsConstants.TARGET_TYPE_CUSTOM.equals(newTargetType)) || (ApiJmsConstants.TARGET_TYPE_ME.equals(newTargetType))) { jcaManagedConnectionFactory.setTargetType(newTargetType); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "remoteTargetType", newTargetType }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTargetType"); }
java
@Override public void setTargetType(String newTargetType) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTargetType", newTargetType); // Check for null and empty string, and set to default value if found if ((newTargetType == null) || ("".equals(newTargetType))) { jcaManagedConnectionFactory.setTargetType(ApiJmsConstants.TARGET_TYPE_BUSMEMBER); } // Ensure that the value is one of the permitted constants - thrown an exception if not else if ((ApiJmsConstants.TARGET_TYPE_BUSMEMBER.equals(newTargetType)) || (ApiJmsConstants.TARGET_TYPE_CUSTOM.equals(newTargetType)) || (ApiJmsConstants.TARGET_TYPE_ME.equals(newTargetType))) { jcaManagedConnectionFactory.setTargetType(newTargetType); } else { throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "remoteTargetType", newTargetType }, tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTargetType"); }
[ "@", "Override", "public", "void", "setTargetType", "(", "String", "newTargetType", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setTargetType\"", ",", "newTargetType", ")", ";", "// Check for null and empty string, and set to default value if found", "if", "(", "(", "newTargetType", "==", "null", ")", "||", "(", "\"\"", ".", "equals", "(", "newTargetType", ")", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setTargetType", "(", "ApiJmsConstants", ".", "TARGET_TYPE_BUSMEMBER", ")", ";", "}", "// Ensure that the value is one of the permitted constants - thrown an exception if not", "else", "if", "(", "(", "ApiJmsConstants", ".", "TARGET_TYPE_BUSMEMBER", ".", "equals", "(", "newTargetType", ")", ")", "||", "(", "ApiJmsConstants", ".", "TARGET_TYPE_CUSTOM", ".", "equals", "(", "newTargetType", ")", ")", "||", "(", "ApiJmsConstants", ".", "TARGET_TYPE_ME", ".", "equals", "(", "newTargetType", ")", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setTargetType", "(", "newTargetType", ")", ";", "}", "else", "{", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"remoteTargetType\"", ",", "newTargetType", "}", ",", "tc", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setTargetType\"", ")", ";", "}" ]
Set the target type 181802.2 @param newTargetType The target type to use @see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#setTargetType(java.lang.String)
[ "Set", "the", "target", "type", "181802", ".", "2" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L400-L426
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setTemporaryQueueNamePrefix
@Override public void setTemporaryQueueNamePrefix(String prefix) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTemporaryQueueNamePrefix", prefix); if (prefix != null && !prefix.equals("")) { jcaManagedConnectionFactory.setTemporaryQueueNamePrefix(prefix); } else { jcaManagedConnectionFactory.setTemporaryQueueNamePrefix(null); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTemporaryQueueNamePrefix"); }
java
@Override public void setTemporaryQueueNamePrefix(String prefix) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setTemporaryQueueNamePrefix", prefix); if (prefix != null && !prefix.equals("")) { jcaManagedConnectionFactory.setTemporaryQueueNamePrefix(prefix); } else { jcaManagedConnectionFactory.setTemporaryQueueNamePrefix(null); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setTemporaryQueueNamePrefix"); }
[ "@", "Override", "public", "void", "setTemporaryQueueNamePrefix", "(", "String", "prefix", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setTemporaryQueueNamePrefix\"", ",", "prefix", ")", ";", "if", "(", "prefix", "!=", "null", "&&", "!", "prefix", ".", "equals", "(", "\"\"", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setTemporaryQueueNamePrefix", "(", "prefix", ")", ";", "}", "else", "{", "jcaManagedConnectionFactory", ".", "setTemporaryQueueNamePrefix", "(", "null", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setTemporaryQueueNamePrefix\"", ")", ";", "}" ]
Set the temp queue name prefix 188482 @param prefix The String prefix to use @see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#setTemporaryQueueNamePrefix(java.lang.String)
[ "Set", "the", "temp", "queue", "name", "prefix", "188482" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L435-L449
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setMulticastInterface
@Override public void setMulticastInterface(String mi) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setMulticastInterface", mi); jcaManagedConnectionFactory.setMulticastInterface(mi); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setMulticastInterface"); }
java
@Override public void setMulticastInterface(String mi) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setMulticastInterface", mi); jcaManagedConnectionFactory.setMulticastInterface(mi); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setMulticastInterface"); }
[ "@", "Override", "public", "void", "setMulticastInterface", "(", "String", "mi", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setMulticastInterface\"", ",", "mi", ")", ";", "jcaManagedConnectionFactory", ".", "setMulticastInterface", "(", "mi", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setMulticastInterface\"", ")", ";", "}" ]
Set network interface to be used for multicast data. @param mi The IP address of the network interface. @see ApiJmsConstants.MULTICAST_INTERFACE_NONE
[ "Set", "network", "interface", "to", "be", "used", "for", "multicast", "data", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L541-L548
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setSubscriptionProtocol
@Override public void setSubscriptionProtocol(String p) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setSubscriptionProtocol", p); if (ApiJmsConstants.SUBSCRIPTION_PROTOCOL_UNICAST.equals(p) || ApiJmsConstants.SUBSCRIPTION_PROTOCOL_MULTICAST.equals(p) || ApiJmsConstants.SUBSCRIPTION_PROTOCOL_UNICAST_AND_MULTICAST.equals(p)) { jcaManagedConnectionFactory.setSubscriptionProtocol(p); } else { // This is not a legal value. throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "subscriptionProtocol", p }, tc); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setSubscriptionProtocol"); }
java
@Override public void setSubscriptionProtocol(String p) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setSubscriptionProtocol", p); if (ApiJmsConstants.SUBSCRIPTION_PROTOCOL_UNICAST.equals(p) || ApiJmsConstants.SUBSCRIPTION_PROTOCOL_MULTICAST.equals(p) || ApiJmsConstants.SUBSCRIPTION_PROTOCOL_UNICAST_AND_MULTICAST.equals(p)) { jcaManagedConnectionFactory.setSubscriptionProtocol(p); } else { // This is not a legal value. throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "subscriptionProtocol", p }, tc); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setSubscriptionProtocol"); }
[ "@", "Override", "public", "void", "setSubscriptionProtocol", "(", "String", "p", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setSubscriptionProtocol\"", ",", "p", ")", ";", "if", "(", "ApiJmsConstants", ".", "SUBSCRIPTION_PROTOCOL_UNICAST", ".", "equals", "(", "p", ")", "||", "ApiJmsConstants", ".", "SUBSCRIPTION_PROTOCOL_MULTICAST", ".", "equals", "(", "p", ")", "||", "ApiJmsConstants", ".", "SUBSCRIPTION_PROTOCOL_UNICAST_AND_MULTICAST", ".", "equals", "(", "p", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setSubscriptionProtocol", "(", "p", ")", ";", "}", "else", "{", "// This is not a legal value.", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"subscriptionProtocol\"", ",", "p", "}", ",", "tc", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setSubscriptionProtocol\"", ")", ";", "}" ]
Set the subscription protocol to be used for the transmission of message data from the ME to the client. @param the protocol to use. @see ApiJmsConstants.SUBSCRIPTION_PROTOCOL_UNICAST @see ApiJmsConstants.SUBSCRIPTION_PROTOCOL_MULTICAST @see ApiJmsConstants.SUBSCRIPTION_PROTOCOL_UNICAST_AND_MULTICAST
[ "Set", "the", "subscription", "protocol", "to", "be", "used", "for", "the", "transmission", "of", "message", "data", "from", "the", "ME", "to", "the", "client", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L559-L577
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java
JmsConnectionFactoryImpl.setProducerDoesNotModifyPayloadAfterSet
@Override public void setProducerDoesNotModifyPayloadAfterSet(String propertyValue) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setProducerDoesNotModifyPayloadAfterSet", propertyValue); // First of all, convert null and empty to mean the default. if ((propertyValue == null) || ("".equals(propertyValue))) { jcaManagedConnectionFactory.setProducerDoesNotModifyPayloadAfterSet(ApiJmsConstants.MIGHT_MODIFY_PAYLOAD); } // Check for valid values else if (propertyValue.equalsIgnoreCase(ApiJmsConstants.MIGHT_MODIFY_PAYLOAD) || propertyValue.equalsIgnoreCase(ApiJmsConstants.WILL_NOT_MODIFY_PAYLOAD)) { jcaManagedConnectionFactory.setProducerDoesNotModifyPayloadAfterSet(propertyValue); } else { // This is not a legal value -> throw a JMS exception throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "producerDoesNotModifyPayloadAfterSet", propertyValue }, tc); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setProducerDoesNotModifyPayloadAfterSet"); }
java
@Override public void setProducerDoesNotModifyPayloadAfterSet(String propertyValue) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setProducerDoesNotModifyPayloadAfterSet", propertyValue); // First of all, convert null and empty to mean the default. if ((propertyValue == null) || ("".equals(propertyValue))) { jcaManagedConnectionFactory.setProducerDoesNotModifyPayloadAfterSet(ApiJmsConstants.MIGHT_MODIFY_PAYLOAD); } // Check for valid values else if (propertyValue.equalsIgnoreCase(ApiJmsConstants.MIGHT_MODIFY_PAYLOAD) || propertyValue.equalsIgnoreCase(ApiJmsConstants.WILL_NOT_MODIFY_PAYLOAD)) { jcaManagedConnectionFactory.setProducerDoesNotModifyPayloadAfterSet(propertyValue); } else { // This is not a legal value -> throw a JMS exception throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "INVALID_VALUE_CWSIA0261", new Object[] { "producerDoesNotModifyPayloadAfterSet", propertyValue }, tc); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setProducerDoesNotModifyPayloadAfterSet"); }
[ "@", "Override", "public", "void", "setProducerDoesNotModifyPayloadAfterSet", "(", "String", "propertyValue", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setProducerDoesNotModifyPayloadAfterSet\"", ",", "propertyValue", ")", ";", "// First of all, convert null and empty to mean the default.", "if", "(", "(", "propertyValue", "==", "null", ")", "||", "(", "\"\"", ".", "equals", "(", "propertyValue", ")", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setProducerDoesNotModifyPayloadAfterSet", "(", "ApiJmsConstants", ".", "MIGHT_MODIFY_PAYLOAD", ")", ";", "}", "// Check for valid values", "else", "if", "(", "propertyValue", ".", "equalsIgnoreCase", "(", "ApiJmsConstants", ".", "MIGHT_MODIFY_PAYLOAD", ")", "||", "propertyValue", ".", "equalsIgnoreCase", "(", "ApiJmsConstants", ".", "WILL_NOT_MODIFY_PAYLOAD", ")", ")", "{", "jcaManagedConnectionFactory", ".", "setProducerDoesNotModifyPayloadAfterSet", "(", "propertyValue", ")", ";", "}", "else", "{", "// This is not a legal value -> throw a JMS exception", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0261\"", ",", "new", "Object", "[", "]", "{", "\"producerDoesNotModifyPayloadAfterSet\"", ",", "propertyValue", "}", ",", "tc", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setProducerDoesNotModifyPayloadAfterSet\"", ")", ";", "}" ]
Sets the property that indicates if the producer will modify the payload after setting it. @param propertyValue containing the property value. @throws JMSException In the event of an invalid value
[ "Sets", "the", "property", "that", "indicates", "if", "the", "producer", "will", "modify", "the", "payload", "after", "setting", "it", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsConnectionFactoryImpl.java#L585-L609
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/CRLDistPoint.java
CRLDistPoint.getDistributionPoints
public DistributionPoint[] getDistributionPoints() { DistributionPoint[] dp = new DistributionPoint[seq.size()]; for (int i = 0; i != seq.size(); i++) { dp[i] = DistributionPoint.getInstance(seq.getObjectAt(i)); } return dp; }
java
public DistributionPoint[] getDistributionPoints() { DistributionPoint[] dp = new DistributionPoint[seq.size()]; for (int i = 0; i != seq.size(); i++) { dp[i] = DistributionPoint.getInstance(seq.getObjectAt(i)); } return dp; }
[ "public", "DistributionPoint", "[", "]", "getDistributionPoints", "(", ")", "{", "DistributionPoint", "[", "]", "dp", "=", "new", "DistributionPoint", "[", "seq", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "!=", "seq", ".", "size", "(", ")", ";", "i", "++", ")", "{", "dp", "[", "i", "]", "=", "DistributionPoint", ".", "getInstance", "(", "seq", ".", "getObjectAt", "(", "i", ")", ")", ";", "}", "return", "dp", ";", "}" ]
Return the distribution points making up the sequence. @return DistributionPoint[]
[ "Return", "the", "distribution", "points", "making", "up", "the", "sequence", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/CRLDistPoint.java#L75-L85
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/J2CUtilityClass.java
J2CUtilityClass.getNextThrowable
public static Throwable getNextThrowable(Throwable t) { Throwable nextThrowable = null; if (t != null) { // try getCause first. nextThrowable = t.getCause(); if (nextThrowable == null) { // if getCause returns null, look for the JDBC and JCA specific chained exceptions // in case the resource adapter or database has not implemented getCause and initCause yet. if (t instanceof SQLException) { nextThrowable = ((SQLException) t).getNextException(); } else if (t instanceof ResourceException) { nextThrowable = ((ResourceException) t).getCause(); } } } return nextThrowable; }
java
public static Throwable getNextThrowable(Throwable t) { Throwable nextThrowable = null; if (t != null) { // try getCause first. nextThrowable = t.getCause(); if (nextThrowable == null) { // if getCause returns null, look for the JDBC and JCA specific chained exceptions // in case the resource adapter or database has not implemented getCause and initCause yet. if (t instanceof SQLException) { nextThrowable = ((SQLException) t).getNextException(); } else if (t instanceof ResourceException) { nextThrowable = ((ResourceException) t).getCause(); } } } return nextThrowable; }
[ "public", "static", "Throwable", "getNextThrowable", "(", "Throwable", "t", ")", "{", "Throwable", "nextThrowable", "=", "null", ";", "if", "(", "t", "!=", "null", ")", "{", "// try getCause first.", "nextThrowable", "=", "t", ".", "getCause", "(", ")", ";", "if", "(", "nextThrowable", "==", "null", ")", "{", "// if getCause returns null, look for the JDBC and JCA specific chained exceptions", "// in case the resource adapter or database has not implemented getCause and initCause yet.", "if", "(", "t", "instanceof", "SQLException", ")", "{", "nextThrowable", "=", "(", "(", "SQLException", ")", "t", ")", ".", "getNextException", "(", ")", ";", "}", "else", "if", "(", "t", "instanceof", "ResourceException", ")", "{", "nextThrowable", "=", "(", "(", "ResourceException", ")", "t", ")", ".", "getCause", "(", ")", ";", "}", "}", "}", "return", "nextThrowable", ";", "}" ]
Finds the next Throwable object from the one provided. @param t The throwable to start with @return The next or linked, or initial cause.
[ "Finds", "the", "next", "Throwable", "object", "from", "the", "one", "provided", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/J2CUtilityClass.java#L89-L110
train
OpenLiberty/open-liberty
dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/ChangeControl.java
ChangeControl.getCheckPoint
public List<com.ibm.wsspi.security.wim.model.CheckPointType> getCheckPoint() { if (checkPoint == null) { checkPoint = new ArrayList<com.ibm.wsspi.security.wim.model.CheckPointType>(); } return this.checkPoint; }
java
public List<com.ibm.wsspi.security.wim.model.CheckPointType> getCheckPoint() { if (checkPoint == null) { checkPoint = new ArrayList<com.ibm.wsspi.security.wim.model.CheckPointType>(); } return this.checkPoint; }
[ "public", "List", "<", "com", ".", "ibm", ".", "wsspi", ".", "security", ".", "wim", ".", "model", ".", "CheckPointType", ">", "getCheckPoint", "(", ")", "{", "if", "(", "checkPoint", "==", "null", ")", "{", "checkPoint", "=", "new", "ArrayList", "<", "com", ".", "ibm", ".", "wsspi", ".", "security", ".", "wim", ".", "model", ".", "CheckPointType", ">", "(", ")", ";", "}", "return", "this", ".", "checkPoint", ";", "}" ]
Gets the value of the checkPoint property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the checkPoint property. <p> For example, to add a new item, do as follows: <pre> getCheckPoint().add(newItem); </pre> <p> Objects of the following type(s) are allowed in the list {@link com.ibm.wsspi.security.wim.model.CheckPointType }
[ "Gets", "the", "value", "of", "the", "checkPoint", "property", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/ChangeControl.java#L117-L122
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringConsumerKey.java
GatheringConsumerKey.isKeyReady
public boolean isKeyReady() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isKeyReady"); boolean returnValue = false; if(keyGroup == null) returnValue = ready; else //check if the ordering context is ready returnValue = keyGroup.isKeyReady(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isKeyReady", Boolean.valueOf(returnValue)); return returnValue; }
java
public boolean isKeyReady() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isKeyReady"); boolean returnValue = false; if(keyGroup == null) returnValue = ready; else //check if the ordering context is ready returnValue = keyGroup.isKeyReady(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isKeyReady", Boolean.valueOf(returnValue)); return returnValue; }
[ "public", "boolean", "isKeyReady", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"isKeyReady\"", ")", ";", "boolean", "returnValue", "=", "false", ";", "if", "(", "keyGroup", "==", "null", ")", "returnValue", "=", "ready", ";", "else", "//check if the ordering context is ready", "returnValue", "=", "keyGroup", ".", "isKeyReady", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"isKeyReady\"", ",", "Boolean", ".", "valueOf", "(", "returnValue", ")", ")", ";", "return", "returnValue", ";", "}" ]
Determine if this key is ready No need to synchronize as this should be called under the readyConsumerPointLock
[ "Determine", "if", "this", "key", "is", "ready", "No", "need", "to", "synchronize", "as", "this", "should", "be", "called", "under", "the", "readyConsumerPointLock" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringConsumerKey.java#L297-L313
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringConsumerKey.java
GatheringConsumerKey.markNotReady
public synchronized void markNotReady() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "markNotReady"); // No-op if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "markNotReady"); }
java
public synchronized void markNotReady() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "markNotReady"); // No-op if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "markNotReady"); }
[ "public", "synchronized", "void", "markNotReady", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"markNotReady\"", ")", ";", "// No-op", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"markNotReady\"", ")", ";", "}" ]
No-op for gathering
[ "No", "-", "op", "for", "gathering" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringConsumerKey.java#L316-L325
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringConsumerKey.java
GatheringConsumerKey.reattachConsumer
public void reattachConsumer(SIBUuid8 uuid, ConsumableKey ck) throws SINotPossibleInCurrentConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "reattachConsumer", new Object[] {uuid, ck}); long timeout = LocalConsumerPoint.NO_WAIT; synchronized(this) { if (!closed) { // Set the new consumer key to be the same ready state as the rest // of the gathering consumer if (isKeyReady()) { //get the readyConsumer list lock synchronized (dispatcher.getDestination().getReadyConsumerPointLock()) { ck.ready(unrecoverable); } } consumerKeys.put(uuid, ck); // Work out the expiry time if any of the outstanding requests if (outstandingRequestExpiryTime != LocalConsumerPoint.NO_WAIT) { timeout = outstandingRequestExpiryTime; if (timeout != LocalConsumerPoint.INFINITE_WAIT) timeout = outstandingRequestExpiryTime - System.currentTimeMillis(); } } } // outside of the lock - reissue the request if (timeout == LocalConsumerPoint.INFINITE_WAIT || timeout > 0) { ((LocalQPConsumerKey)ck).initiateRefill(); ck.waiting(timeout, true); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "reattachConsumer"); }
java
public void reattachConsumer(SIBUuid8 uuid, ConsumableKey ck) throws SINotPossibleInCurrentConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "reattachConsumer", new Object[] {uuid, ck}); long timeout = LocalConsumerPoint.NO_WAIT; synchronized(this) { if (!closed) { // Set the new consumer key to be the same ready state as the rest // of the gathering consumer if (isKeyReady()) { //get the readyConsumer list lock synchronized (dispatcher.getDestination().getReadyConsumerPointLock()) { ck.ready(unrecoverable); } } consumerKeys.put(uuid, ck); // Work out the expiry time if any of the outstanding requests if (outstandingRequestExpiryTime != LocalConsumerPoint.NO_WAIT) { timeout = outstandingRequestExpiryTime; if (timeout != LocalConsumerPoint.INFINITE_WAIT) timeout = outstandingRequestExpiryTime - System.currentTimeMillis(); } } } // outside of the lock - reissue the request if (timeout == LocalConsumerPoint.INFINITE_WAIT || timeout > 0) { ((LocalQPConsumerKey)ck).initiateRefill(); ck.waiting(timeout, true); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "reattachConsumer"); }
[ "public", "void", "reattachConsumer", "(", "SIBUuid8", "uuid", ",", "ConsumableKey", "ck", ")", "throws", "SINotPossibleInCurrentConfigurationException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"reattachConsumer\"", ",", "new", "Object", "[", "]", "{", "uuid", ",", "ck", "}", ")", ";", "long", "timeout", "=", "LocalConsumerPoint", ".", "NO_WAIT", ";", "synchronized", "(", "this", ")", "{", "if", "(", "!", "closed", ")", "{", "// Set the new consumer key to be the same ready state as the rest ", "// of the gathering consumer ", "if", "(", "isKeyReady", "(", ")", ")", "{", "//get the readyConsumer list lock", "synchronized", "(", "dispatcher", ".", "getDestination", "(", ")", ".", "getReadyConsumerPointLock", "(", ")", ")", "{", "ck", ".", "ready", "(", "unrecoverable", ")", ";", "}", "}", "consumerKeys", ".", "put", "(", "uuid", ",", "ck", ")", ";", "// Work out the expiry time if any of the outstanding requests", "if", "(", "outstandingRequestExpiryTime", "!=", "LocalConsumerPoint", ".", "NO_WAIT", ")", "{", "timeout", "=", "outstandingRequestExpiryTime", ";", "if", "(", "timeout", "!=", "LocalConsumerPoint", ".", "INFINITE_WAIT", ")", "timeout", "=", "outstandingRequestExpiryTime", "-", "System", ".", "currentTimeMillis", "(", ")", ";", "}", "}", "}", "// outside of the lock - reissue the request", "if", "(", "timeout", "==", "LocalConsumerPoint", ".", "INFINITE_WAIT", "||", "timeout", ">", "0", ")", "{", "(", "(", "LocalQPConsumerKey", ")", "ck", ")", ".", "initiateRefill", "(", ")", ";", "ck", ".", "waiting", "(", "timeout", ",", "true", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"reattachConsumer\"", ")", ";", "}" ]
Also add the consumer key back into the list.
[ "Also", "add", "the", "consumer", "key", "back", "into", "the", "list", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/GatheringConsumerKey.java#L530-L575
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java
AbstractObjectStore.like
public Token like(Token likeToken) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "like", new Object[] { likeToken }); // See if we already have a copy of the object in memory. If so we must reuse // it so that all references to the object via the object store point to the // same object. Otherwise multiple instances of the object might get created by // multiple Get calls against multiple instances of the the ManagedObject. Token inMemoryToken = (Token) inMemoryTokens.putIfAbsent(new Long(likeToken.storedObjectIdentifier), likeToken); if (inMemoryToken == null) { // We just established the definitive version of the Token. inMemoryToken = likeToken; synchronized (sequenceNumberLock) { // We should not have to do this check if the application has already allocated the Object // but during recovery we will be restablishing the largest sequence number used // for non persistenmt ObjectStores. if (likeToken.storedObjectIdentifier > sequenceNumber) { sequenceNumber = Math.max(likeToken.storedObjectIdentifier, sequenceNumber); } // if (likeToken.storedObjectIdentifier > sequenceNumber). } // synchronized (sequenceNumberLock). } // if (inMemoryToken == null). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "like", new Object[] { inMemoryToken }); return inMemoryToken; }
java
public Token like(Token likeToken) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "like", new Object[] { likeToken }); // See if we already have a copy of the object in memory. If so we must reuse // it so that all references to the object via the object store point to the // same object. Otherwise multiple instances of the object might get created by // multiple Get calls against multiple instances of the the ManagedObject. Token inMemoryToken = (Token) inMemoryTokens.putIfAbsent(new Long(likeToken.storedObjectIdentifier), likeToken); if (inMemoryToken == null) { // We just established the definitive version of the Token. inMemoryToken = likeToken; synchronized (sequenceNumberLock) { // We should not have to do this check if the application has already allocated the Object // but during recovery we will be restablishing the largest sequence number used // for non persistenmt ObjectStores. if (likeToken.storedObjectIdentifier > sequenceNumber) { sequenceNumber = Math.max(likeToken.storedObjectIdentifier, sequenceNumber); } // if (likeToken.storedObjectIdentifier > sequenceNumber). } // synchronized (sequenceNumberLock). } // if (inMemoryToken == null). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "like", new Object[] { inMemoryToken }); return inMemoryToken; }
[ "public", "Token", "like", "(", "Token", "likeToken", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"like\"", ",", "new", "Object", "[", "]", "{", "likeToken", "}", ")", ";", "// See if we already have a copy of the object in memory. If so we must reuse", "// it so that all references to the object via the object store point to the", "// same object. Otherwise multiple instances of the object might get created by ", "// multiple Get calls against multiple instances of the the ManagedObject. ", "Token", "inMemoryToken", "=", "(", "Token", ")", "inMemoryTokens", ".", "putIfAbsent", "(", "new", "Long", "(", "likeToken", ".", "storedObjectIdentifier", ")", ",", "likeToken", ")", ";", "if", "(", "inMemoryToken", "==", "null", ")", "{", "// We just established the definitive version of the Token.", "inMemoryToken", "=", "likeToken", ";", "synchronized", "(", "sequenceNumberLock", ")", "{", "// We should not have to do this check if the application has already allocated the Object", "// but during recovery we will be restablishing the largest sequence number used", "// for non persistenmt ObjectStores.", "if", "(", "likeToken", ".", "storedObjectIdentifier", ">", "sequenceNumber", ")", "{", "sequenceNumber", "=", "Math", ".", "max", "(", "likeToken", ".", "storedObjectIdentifier", ",", "sequenceNumber", ")", ";", "}", "// if (likeToken.storedObjectIdentifier > sequenceNumber).", "}", "// synchronized (sequenceNumberLock).", "}", "// if (inMemoryToken == null).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"like\"", ",", "new", "Object", "[", "]", "{", "inMemoryToken", "}", ")", ";", "return", "inMemoryToken", ";", "}" ]
References a ManagedObject at the same location in the store. Used to make sure that the caller is refering to the same object as all other users of the ManagedObject. @param likeToken which is a prototype of the Token we are looking for. @return the definitive version of the Token.
[ "References", "a", "ManagedObject", "at", "the", "same", "location", "in", "the", "store", ".", "Used", "to", "make", "sure", "that", "the", "caller", "is", "refering", "to", "the", "same", "object", "as", "all", "other", "users", "of", "the", "ManagedObject", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java#L265-L300
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java
AbstractObjectStore.allocate
public Token allocate(ManagedObject objectToStore) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "allocate", objectToStore); // We cannot store null, it won't serialize and we have no way to manage the transaction state. if (objectToStore == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "allocate", objectToStore); throw new InvalidObjectToStoreException(this, objectToStore); } // If asked to store null. // Is the store full? if (!allocationAllowed) { // request or wait for a checkpoint and see if that helps if (getStoreFullWaitForCheckPoint()) { if (trace.isDebugEnabled()) trace.debug(this, cclass, "allocate", "Store is currently full, waiting for checkpoint"); objectManagerState.waitForCheckpoint(true); } else { if (trace.isDebugEnabled()) trace.debug(this, cclass, "allocate", "Store is currently full, requesting checkpoint"); objectManagerState.requestCheckpoint(true); } if (!allocationAllowed) { if (trace.isEntryEnabled()) trace.exit(this, cclass , "allocate" ); throw new ObjectStoreFullException(this , objectToStore); } } // If (!allocationAllowed). Token tokenToStore; long usableSequenceNumber; synchronized (sequenceNumberLock) { // Establish the sequence number we will use. usableSequenceNumber = ++sequenceNumber; } // synchronized (sequenceNumberLock). // Create the container for the object. tokenToStore = new Token(objectToStore, this, usableSequenceNumber); // Keep a note of the in memory copy of the object so that we give back the same one // whenever it is asked for. // If the application never adds the object, we would clean this up when its reference to the Object // is lost. Token inMemoryToken = (Token) inMemoryTokens.putIfAbsent(new Long(usableSequenceNumber), tokenToStore); // Check that this genuinely a new storedObjectIdentifier. if (inMemoryToken != null) { if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, "allocate", new Object[] { "via StoreSequenceException", inMemoryToken, new Long(sequenceNumber) }); StoreSequenceException storeSequenceException = new StoreSequenceException(this, sequenceNumber, inMemoryToken); ObjectManager.ffdc.processException(this, cclass, "add", storeSequenceException, "1:402:1.31"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "allocate", storeSequenceException); throw storeSequenceException; } // if (inMemoryToken != null). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "allocate" , new Object[] { tokenToStore } ); return tokenToStore; }
java
public Token allocate(ManagedObject objectToStore) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "allocate", objectToStore); // We cannot store null, it won't serialize and we have no way to manage the transaction state. if (objectToStore == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "allocate", objectToStore); throw new InvalidObjectToStoreException(this, objectToStore); } // If asked to store null. // Is the store full? if (!allocationAllowed) { // request or wait for a checkpoint and see if that helps if (getStoreFullWaitForCheckPoint()) { if (trace.isDebugEnabled()) trace.debug(this, cclass, "allocate", "Store is currently full, waiting for checkpoint"); objectManagerState.waitForCheckpoint(true); } else { if (trace.isDebugEnabled()) trace.debug(this, cclass, "allocate", "Store is currently full, requesting checkpoint"); objectManagerState.requestCheckpoint(true); } if (!allocationAllowed) { if (trace.isEntryEnabled()) trace.exit(this, cclass , "allocate" ); throw new ObjectStoreFullException(this , objectToStore); } } // If (!allocationAllowed). Token tokenToStore; long usableSequenceNumber; synchronized (sequenceNumberLock) { // Establish the sequence number we will use. usableSequenceNumber = ++sequenceNumber; } // synchronized (sequenceNumberLock). // Create the container for the object. tokenToStore = new Token(objectToStore, this, usableSequenceNumber); // Keep a note of the in memory copy of the object so that we give back the same one // whenever it is asked for. // If the application never adds the object, we would clean this up when its reference to the Object // is lost. Token inMemoryToken = (Token) inMemoryTokens.putIfAbsent(new Long(usableSequenceNumber), tokenToStore); // Check that this genuinely a new storedObjectIdentifier. if (inMemoryToken != null) { if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, "allocate", new Object[] { "via StoreSequenceException", inMemoryToken, new Long(sequenceNumber) }); StoreSequenceException storeSequenceException = new StoreSequenceException(this, sequenceNumber, inMemoryToken); ObjectManager.ffdc.processException(this, cclass, "add", storeSequenceException, "1:402:1.31"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "allocate", storeSequenceException); throw storeSequenceException; } // if (inMemoryToken != null). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "allocate" , new Object[] { tokenToStore } ); return tokenToStore; }
[ "public", "Token", "allocate", "(", "ManagedObject", "objectToStore", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"allocate\"", ",", "objectToStore", ")", ";", "// We cannot store null, it won't serialize and we have no way to manage the transaction state.", "if", "(", "objectToStore", "==", "null", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"allocate\"", ",", "objectToStore", ")", ";", "throw", "new", "InvalidObjectToStoreException", "(", "this", ",", "objectToStore", ")", ";", "}", "// If asked to store null.", "// Is the store full?", "if", "(", "!", "allocationAllowed", ")", "{", "// request or wait for a checkpoint and see if that helps", "if", "(", "getStoreFullWaitForCheckPoint", "(", ")", ")", "{", "if", "(", "trace", ".", "isDebugEnabled", "(", ")", ")", "trace", ".", "debug", "(", "this", ",", "cclass", ",", "\"allocate\"", ",", "\"Store is currently full, waiting for checkpoint\"", ")", ";", "objectManagerState", ".", "waitForCheckpoint", "(", "true", ")", ";", "}", "else", "{", "if", "(", "trace", ".", "isDebugEnabled", "(", ")", ")", "trace", ".", "debug", "(", "this", ",", "cclass", ",", "\"allocate\"", ",", "\"Store is currently full, requesting checkpoint\"", ")", ";", "objectManagerState", ".", "requestCheckpoint", "(", "true", ")", ";", "}", "if", "(", "!", "allocationAllowed", ")", "{", "if", "(", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"allocate\"", ")", ";", "throw", "new", "ObjectStoreFullException", "(", "this", ",", "objectToStore", ")", ";", "}", "}", "// If (!allocationAllowed). ", "Token", "tokenToStore", ";", "long", "usableSequenceNumber", ";", "synchronized", "(", "sequenceNumberLock", ")", "{", "// Establish the sequence number we will use. ", "usableSequenceNumber", "=", "++", "sequenceNumber", ";", "}", "// synchronized (sequenceNumberLock).", "// Create the container for the object. ", "tokenToStore", "=", "new", "Token", "(", "objectToStore", ",", "this", ",", "usableSequenceNumber", ")", ";", "// Keep a note of the in memory copy of the object so that we give back the same one", "// whenever it is asked for.", "// If the application never adds the object, we would clean this up when its reference to the Object", "// is lost. ", "Token", "inMemoryToken", "=", "(", "Token", ")", "inMemoryTokens", ".", "putIfAbsent", "(", "new", "Long", "(", "usableSequenceNumber", ")", ",", "tokenToStore", ")", ";", "// Check that this genuinely a new storedObjectIdentifier.", "if", "(", "inMemoryToken", "!=", "null", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isDebugEnabled", "(", ")", ")", "trace", ".", "debug", "(", "this", ",", "cclass", ",", "\"allocate\"", ",", "new", "Object", "[", "]", "{", "\"via StoreSequenceException\"", ",", "inMemoryToken", ",", "new", "Long", "(", "sequenceNumber", ")", "}", ")", ";", "StoreSequenceException", "storeSequenceException", "=", "new", "StoreSequenceException", "(", "this", ",", "sequenceNumber", ",", "inMemoryToken", ")", ";", "ObjectManager", ".", "ffdc", ".", "processException", "(", "this", ",", "cclass", ",", "\"add\"", ",", "storeSequenceException", ",", "\"1:402:1.31\"", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"allocate\"", ",", "storeSequenceException", ")", ";", "throw", "storeSequenceException", ";", "}", "// if (inMemoryToken != null).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"allocate\"", ",", "new", "Object", "[", "]", "{", "tokenToStore", "}", ")", ";", "return", "tokenToStore", ";", "}" ]
Allocate a Token for the ManagedObject. @param objectToStore to be allocated a token. @return Token allocated. @throws ObjectManagerException
[ "Allocate", "a", "Token", "for", "the", "ManagedObject", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java#L310-L408
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java
AbstractObjectStore.getIdentifier
public int getIdentifier() { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) { trace.entry(this, cclass , "getIdentifier" ); trace.exit(this, cclass , "getIdentifier" , "returns objectStoreIdentifier=" + objectStoreIdentifier + "(int)" ); } return objectStoreIdentifier; }
java
public int getIdentifier() { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) { trace.entry(this, cclass , "getIdentifier" ); trace.exit(this, cclass , "getIdentifier" , "returns objectStoreIdentifier=" + objectStoreIdentifier + "(int)" ); } return objectStoreIdentifier; }
[ "public", "int", "getIdentifier", "(", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "{", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"getIdentifier\"", ")", ";", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"getIdentifier\"", ",", "\"returns objectStoreIdentifier=\"", "+", "objectStoreIdentifier", "+", "\"(int)\"", ")", ";", "}", "return", "objectStoreIdentifier", ";", "}" ]
The identifier of the ObjectStore, unique within this ObjectManager. @return int the objectStore identifier
[ "The", "identifier", "of", "the", "ObjectStore", "unique", "within", "this", "ObjectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java#L584-L598
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java
AbstractObjectStore.setIdentifier
public void setIdentifier(int identifier) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "setIdentifier", new Object[] { new Integer(identifier) }); // We can only set this once. if (objectStoreIdentifier != IDENTIFIER_NOT_SET) { InvalidConditionException invalidConditionException = new InvalidConditionException(this , "objectStoreIdentifier" , Integer.toString(objectStoreIdentifier) + "not equal IDENTIFIER_NOT_SET" ); ObjectManager.ffdc.processException(this, cclass, "setIdentifier", invalidConditionException, "1:623:1.31", new Object[] { new Integer(objectStoreIdentifier) }); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setIdentifier" , invalidConditionException ); throw invalidConditionException; } // if (objectStoreIdentifier != IDENTIFIER_NOT_SET). objectStoreIdentifier = identifier; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setIdentifier" ); }
java
public void setIdentifier(int identifier) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "setIdentifier", new Object[] { new Integer(identifier) }); // We can only set this once. if (objectStoreIdentifier != IDENTIFIER_NOT_SET) { InvalidConditionException invalidConditionException = new InvalidConditionException(this , "objectStoreIdentifier" , Integer.toString(objectStoreIdentifier) + "not equal IDENTIFIER_NOT_SET" ); ObjectManager.ffdc.processException(this, cclass, "setIdentifier", invalidConditionException, "1:623:1.31", new Object[] { new Integer(objectStoreIdentifier) }); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setIdentifier" , invalidConditionException ); throw invalidConditionException; } // if (objectStoreIdentifier != IDENTIFIER_NOT_SET). objectStoreIdentifier = identifier; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setIdentifier" ); }
[ "public", "void", "setIdentifier", "(", "int", "identifier", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"setIdentifier\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "identifier", ")", "}", ")", ";", "// We can only set this once. ", "if", "(", "objectStoreIdentifier", "!=", "IDENTIFIER_NOT_SET", ")", "{", "InvalidConditionException", "invalidConditionException", "=", "new", "InvalidConditionException", "(", "this", ",", "\"objectStoreIdentifier\"", ",", "Integer", ".", "toString", "(", "objectStoreIdentifier", ")", "+", "\"not equal IDENTIFIER_NOT_SET\"", ")", ";", "ObjectManager", ".", "ffdc", ".", "processException", "(", "this", ",", "cclass", ",", "\"setIdentifier\"", ",", "invalidConditionException", ",", "\"1:623:1.31\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "objectStoreIdentifier", ")", "}", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"setIdentifier\"", ",", "invalidConditionException", ")", ";", "throw", "invalidConditionException", ";", "}", "// if (objectStoreIdentifier != IDENTIFIER_NOT_SET).", "objectStoreIdentifier", "=", "identifier", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"setIdentifier\"", ")", ";", "}" ]
Set the identifier of the Object Store, unique within this ObjectManager. @param identifier the assigned objectStore identifier @throws ObjectManagerException
[ "Set", "the", "identifier", "of", "the", "Object", "Store", "unique", "within", "this", "ObjectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java#L606-L640
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java
AbstractObjectStore.getName
public final String getName() { final String methodName = "getName"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) { trace.entry(this, cclass, methodName); trace.exit(this, cclass, methodName, new Object[] { storeName }); } return storeName; }
java
public final String getName() { final String methodName = "getName"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) { trace.entry(this, cclass, methodName); trace.exit(this, cclass, methodName, new Object[] { storeName }); } return storeName; }
[ "public", "final", "String", "getName", "(", ")", "{", "final", "String", "methodName", "=", "\"getName\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "{", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "storeName", "}", ")", ";", "}", "return", "storeName", ";", "}" ]
The name of the ObjectStore. @return String the objectStore name
[ "The", "name", "of", "the", "ObjectStore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractObjectStore.java#L647-L654
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java
UserRegistryServiceImpl.autoDetectUserRegistry
private UserRegistry autoDetectUserRegistry(boolean exceptionOnError) throws RegistryException { // Determine if there is a federation registry configured. UserRegistry ur = getFederationRegistry(exceptionOnError); synchronized (userRegistrySync) { if (ur != null) { setRegistriesToBeFederated((FederationRegistry) ur, exceptionOnError); isFederationActive = true; return ur; } else isFederationActive = false; } if (userRegistries.isEmpty()) { if (exceptionOnError) { Tr.error(tc, "USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE"); throw new RegistryException(TraceNLS.getFormattedMessage(this.getClass(), TraceConstants.MESSAGE_BUNDLE, "USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE", new Object[] {}, "CWWKS3005E: A configuration exception has occurred. No UserRegistry implementation service is available. Ensure that you have a user registry configured.")); } else { return null; } } else if (urCount > 1) { if (exceptionOnError) { Tr.error(tc, "USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE"); throw new RegistryException(TraceNLS.getFormattedMessage( this.getClass(), TraceConstants.MESSAGE_BUNDLE, "USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE", new Object[] {}, "CWWKS3006E: A configuration error has occurred. Multiple available UserRegistry implementation services, unable to determine which to use.")); } else { return null; } } else { String id = userRegistries.keySet().iterator().next(); return getUserRegistry(id, exceptionOnError); } }
java
private UserRegistry autoDetectUserRegistry(boolean exceptionOnError) throws RegistryException { // Determine if there is a federation registry configured. UserRegistry ur = getFederationRegistry(exceptionOnError); synchronized (userRegistrySync) { if (ur != null) { setRegistriesToBeFederated((FederationRegistry) ur, exceptionOnError); isFederationActive = true; return ur; } else isFederationActive = false; } if (userRegistries.isEmpty()) { if (exceptionOnError) { Tr.error(tc, "USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE"); throw new RegistryException(TraceNLS.getFormattedMessage(this.getClass(), TraceConstants.MESSAGE_BUNDLE, "USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE", new Object[] {}, "CWWKS3005E: A configuration exception has occurred. No UserRegistry implementation service is available. Ensure that you have a user registry configured.")); } else { return null; } } else if (urCount > 1) { if (exceptionOnError) { Tr.error(tc, "USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE"); throw new RegistryException(TraceNLS.getFormattedMessage( this.getClass(), TraceConstants.MESSAGE_BUNDLE, "USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE", new Object[] {}, "CWWKS3006E: A configuration error has occurred. Multiple available UserRegistry implementation services, unable to determine which to use.")); } else { return null; } } else { String id = userRegistries.keySet().iterator().next(); return getUserRegistry(id, exceptionOnError); } }
[ "private", "UserRegistry", "autoDetectUserRegistry", "(", "boolean", "exceptionOnError", ")", "throws", "RegistryException", "{", "// Determine if there is a federation registry configured.", "UserRegistry", "ur", "=", "getFederationRegistry", "(", "exceptionOnError", ")", ";", "synchronized", "(", "userRegistrySync", ")", "{", "if", "(", "ur", "!=", "null", ")", "{", "setRegistriesToBeFederated", "(", "(", "FederationRegistry", ")", "ur", ",", "exceptionOnError", ")", ";", "isFederationActive", "=", "true", ";", "return", "ur", ";", "}", "else", "isFederationActive", "=", "false", ";", "}", "if", "(", "userRegistries", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "exceptionOnError", ")", "{", "Tr", ".", "error", "(", "tc", ",", "\"USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE\"", ")", ";", "throw", "new", "RegistryException", "(", "TraceNLS", ".", "getFormattedMessage", "(", "this", ".", "getClass", "(", ")", ",", "TraceConstants", ".", "MESSAGE_BUNDLE", ",", "\"USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE\"", ",", "new", "Object", "[", "]", "{", "}", ",", "\"CWWKS3005E: A configuration exception has occurred. No UserRegistry implementation service is available. Ensure that you have a user registry configured.\"", ")", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "else", "if", "(", "urCount", ">", "1", ")", "{", "if", "(", "exceptionOnError", ")", "{", "Tr", ".", "error", "(", "tc", ",", "\"USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE\"", ")", ";", "throw", "new", "RegistryException", "(", "TraceNLS", ".", "getFormattedMessage", "(", "this", ".", "getClass", "(", ")", ",", "TraceConstants", ".", "MESSAGE_BUNDLE", ",", "\"USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE\"", ",", "new", "Object", "[", "]", "{", "}", ",", "\"CWWKS3006E: A configuration error has occurred. Multiple available UserRegistry implementation services, unable to determine which to use.\"", ")", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "else", "{", "String", "id", "=", "userRegistries", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ".", "next", "(", ")", ";", "return", "getUserRegistry", "(", "id", ",", "exceptionOnError", ")", ";", "}", "}" ]
When a configuration element is not defined, use some "auto-detect" logic to try and return the single UserRegistry. If there is no service, or multiple services, that is considered an error case which "auto-detect" can not resolve. @return @throws RegistryException
[ "When", "a", "configuration", "element", "is", "not", "defined", "use", "some", "auto", "-", "detect", "logic", "to", "try", "and", "return", "the", "single", "UserRegistry", ".", "If", "there", "is", "no", "service", "or", "multiple", "services", "that", "is", "considered", "an", "error", "case", "which", "auto", "-", "detect", "can", "not", "resolve", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java#L391-L429
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java
UserRegistryServiceImpl.getUserRegistryFromConfiguration
private UserRegistry getUserRegistryFromConfiguration() throws RegistryException { String[] refIds = this.refId; if (refIds == null || refIds.length == 0) { // Can look for config.source = file // If thats set, and we're missing this, we can error. // If its not set, we don't have configuration from the // file and we should try to resolve if we have one instance defined? Tr.error(tc, "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID"); throw new RegistryException(TraceNLS.getFormattedMessage( this.getClass(), TraceConstants.MESSAGE_BUNDLE, "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID", null, "CWWKS3000E: A configuration error has occurred. There is no configured refId parameter for the userRegistry configuration.")); } else if (refIds.length == 1) { return getUserRegistry(refIds[0]); } else { // Multiple refIds, we'll use the UserRegistryProxy. List<UserRegistry> delegates = new ArrayList<UserRegistry>(); for (String refId : refIds) { delegates.add(getUserRegistry(refId)); } return new UserRegistryProxy(realm, delegates); } }
java
private UserRegistry getUserRegistryFromConfiguration() throws RegistryException { String[] refIds = this.refId; if (refIds == null || refIds.length == 0) { // Can look for config.source = file // If thats set, and we're missing this, we can error. // If its not set, we don't have configuration from the // file and we should try to resolve if we have one instance defined? Tr.error(tc, "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID"); throw new RegistryException(TraceNLS.getFormattedMessage( this.getClass(), TraceConstants.MESSAGE_BUNDLE, "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID", null, "CWWKS3000E: A configuration error has occurred. There is no configured refId parameter for the userRegistry configuration.")); } else if (refIds.length == 1) { return getUserRegistry(refIds[0]); } else { // Multiple refIds, we'll use the UserRegistryProxy. List<UserRegistry> delegates = new ArrayList<UserRegistry>(); for (String refId : refIds) { delegates.add(getUserRegistry(refId)); } return new UserRegistryProxy(realm, delegates); } }
[ "private", "UserRegistry", "getUserRegistryFromConfiguration", "(", ")", "throws", "RegistryException", "{", "String", "[", "]", "refIds", "=", "this", ".", "refId", ";", "if", "(", "refIds", "==", "null", "||", "refIds", ".", "length", "==", "0", ")", "{", "// Can look for config.source = file", "// If thats set, and we're missing this, we can error.", "// If its not set, we don't have configuration from the", "// file and we should try to resolve if we have one instance defined?", "Tr", ".", "error", "(", "tc", ",", "\"USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID\"", ")", ";", "throw", "new", "RegistryException", "(", "TraceNLS", ".", "getFormattedMessage", "(", "this", ".", "getClass", "(", ")", ",", "TraceConstants", ".", "MESSAGE_BUNDLE", ",", "\"USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID\"", ",", "null", ",", "\"CWWKS3000E: A configuration error has occurred. There is no configured refId parameter for the userRegistry configuration.\"", ")", ")", ";", "}", "else", "if", "(", "refIds", ".", "length", "==", "1", ")", "{", "return", "getUserRegistry", "(", "refIds", "[", "0", "]", ")", ";", "}", "else", "{", "// Multiple refIds, we'll use the UserRegistryProxy.", "List", "<", "UserRegistry", ">", "delegates", "=", "new", "ArrayList", "<", "UserRegistry", ">", "(", ")", ";", "for", "(", "String", "refId", ":", "refIds", ")", "{", "delegates", ".", "add", "(", "getUserRegistry", "(", "refId", ")", ")", ";", "}", "return", "new", "UserRegistryProxy", "(", "realm", ",", "delegates", ")", ";", "}", "}" ]
When a configuration element is defined, use it to resolve the effective UserRegistry configuration. @return @throws RegistryException
[ "When", "a", "configuration", "element", "is", "defined", "use", "it", "to", "resolve", "the", "effective", "UserRegistry", "configuration", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java#L447-L471
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/AioTCPReadRequestContextImpl.java
AioTCPReadRequestContextImpl.processSyncReadRequest
public long processSyncReadRequest(long numBytes, int timeout) throws IOException { long bytesRead = 0; boolean freeJIT = false; IOException exThisTime = null; immedTimeoutRequested = false; setJITAllocateAction(false); this.jITAllocatedDirect = false; // allocate buffers if asked to do so, and none exist if (getJITAllocateSize() > 0 && getBuffers() == null) { if (oTCPConnLink.getConfig().getAllocateBuffersDirect()) { setBuffer(ChannelFrameworkFactory.getBufferManager().allocateDirect(getJITAllocateSize())); this.jITAllocatedDirect = true; } else { setBuffer(ChannelFrameworkFactory.getBufferManager().allocate(getJITAllocateSize())); } setJITAllocateAction(true); } // set context read parameters setIOAmount(numBytes); setLastIOAmt(0); setIODoneAmount(0); setTimeoutTime(timeout); try { bytesRead = ((AioSocketIOChannel) getTCPConnLink().getSocketIOChannel()).readAIOSync(numBytes, this); if (numBytes == 0 && bytesRead == 0) { freeJIT = true; } } catch (AsyncTimeoutException ate) { exThisTime = new SocketTimeoutException(ate.getMessage()); exThisTime.initCause(ate); freeJIT = true; } catch (IOException ioe) { exThisTime = ioe; freeJIT = true; } if (freeJIT && getJITAllocateAction()) { getBuffer().release(); setBuffer(null); setJITAllocateAction(false); } if (exThisTime != null) { throw exThisTime; } return bytesRead; }
java
public long processSyncReadRequest(long numBytes, int timeout) throws IOException { long bytesRead = 0; boolean freeJIT = false; IOException exThisTime = null; immedTimeoutRequested = false; setJITAllocateAction(false); this.jITAllocatedDirect = false; // allocate buffers if asked to do so, and none exist if (getJITAllocateSize() > 0 && getBuffers() == null) { if (oTCPConnLink.getConfig().getAllocateBuffersDirect()) { setBuffer(ChannelFrameworkFactory.getBufferManager().allocateDirect(getJITAllocateSize())); this.jITAllocatedDirect = true; } else { setBuffer(ChannelFrameworkFactory.getBufferManager().allocate(getJITAllocateSize())); } setJITAllocateAction(true); } // set context read parameters setIOAmount(numBytes); setLastIOAmt(0); setIODoneAmount(0); setTimeoutTime(timeout); try { bytesRead = ((AioSocketIOChannel) getTCPConnLink().getSocketIOChannel()).readAIOSync(numBytes, this); if (numBytes == 0 && bytesRead == 0) { freeJIT = true; } } catch (AsyncTimeoutException ate) { exThisTime = new SocketTimeoutException(ate.getMessage()); exThisTime.initCause(ate); freeJIT = true; } catch (IOException ioe) { exThisTime = ioe; freeJIT = true; } if (freeJIT && getJITAllocateAction()) { getBuffer().release(); setBuffer(null); setJITAllocateAction(false); } if (exThisTime != null) { throw exThisTime; } return bytesRead; }
[ "public", "long", "processSyncReadRequest", "(", "long", "numBytes", ",", "int", "timeout", ")", "throws", "IOException", "{", "long", "bytesRead", "=", "0", ";", "boolean", "freeJIT", "=", "false", ";", "IOException", "exThisTime", "=", "null", ";", "immedTimeoutRequested", "=", "false", ";", "setJITAllocateAction", "(", "false", ")", ";", "this", ".", "jITAllocatedDirect", "=", "false", ";", "// allocate buffers if asked to do so, and none exist", "if", "(", "getJITAllocateSize", "(", ")", ">", "0", "&&", "getBuffers", "(", ")", "==", "null", ")", "{", "if", "(", "oTCPConnLink", ".", "getConfig", "(", ")", ".", "getAllocateBuffersDirect", "(", ")", ")", "{", "setBuffer", "(", "ChannelFrameworkFactory", ".", "getBufferManager", "(", ")", ".", "allocateDirect", "(", "getJITAllocateSize", "(", ")", ")", ")", ";", "this", ".", "jITAllocatedDirect", "=", "true", ";", "}", "else", "{", "setBuffer", "(", "ChannelFrameworkFactory", ".", "getBufferManager", "(", ")", ".", "allocate", "(", "getJITAllocateSize", "(", ")", ")", ")", ";", "}", "setJITAllocateAction", "(", "true", ")", ";", "}", "// set context read parameters", "setIOAmount", "(", "numBytes", ")", ";", "setLastIOAmt", "(", "0", ")", ";", "setIODoneAmount", "(", "0", ")", ";", "setTimeoutTime", "(", "timeout", ")", ";", "try", "{", "bytesRead", "=", "(", "(", "AioSocketIOChannel", ")", "getTCPConnLink", "(", ")", ".", "getSocketIOChannel", "(", ")", ")", ".", "readAIOSync", "(", "numBytes", ",", "this", ")", ";", "if", "(", "numBytes", "==", "0", "&&", "bytesRead", "==", "0", ")", "{", "freeJIT", "=", "true", ";", "}", "}", "catch", "(", "AsyncTimeoutException", "ate", ")", "{", "exThisTime", "=", "new", "SocketTimeoutException", "(", "ate", ".", "getMessage", "(", ")", ")", ";", "exThisTime", ".", "initCause", "(", "ate", ")", ";", "freeJIT", "=", "true", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "exThisTime", "=", "ioe", ";", "freeJIT", "=", "true", ";", "}", "if", "(", "freeJIT", "&&", "getJITAllocateAction", "(", ")", ")", "{", "getBuffer", "(", ")", ".", "release", "(", ")", ";", "setBuffer", "(", "null", ")", ";", "setJITAllocateAction", "(", "false", ")", ";", "}", "if", "(", "exThisTime", "!=", "null", ")", "{", "throw", "exThisTime", ";", "}", "return", "bytesRead", ";", "}" ]
that apply here
[ "that", "apply", "here" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/AioTCPReadRequestContextImpl.java#L127-L183
train
OpenLiberty/open-liberty
dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java
JSONSAXHandler.startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes attrs) throws SAXException { if (logger.isLoggable(Level.FINER)) logger.exiting(className, "startElement(String,String,String,org.xml.sax.Attributes)"); Properties props = new Properties(); int attrLength = attrs.getLength(); for (int i = 0; i < attrLength; i++) { props.put(attrs.getQName(i), attrs.getValue(i)); } JSONObject obj = new JSONObject(localName, props); if (this.head == null) { this.head = obj; this.current = head; } else { if (current != null) { this.previousObjects.push(current); this.current.addJSONObject(obj); } this.current = obj; } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "startElement(String,String,String,org.xml.sax.Attributes)"); }
java
public void startElement(String namespaceURI, String localName, String qName, Attributes attrs) throws SAXException { if (logger.isLoggable(Level.FINER)) logger.exiting(className, "startElement(String,String,String,org.xml.sax.Attributes)"); Properties props = new Properties(); int attrLength = attrs.getLength(); for (int i = 0; i < attrLength; i++) { props.put(attrs.getQName(i), attrs.getValue(i)); } JSONObject obj = new JSONObject(localName, props); if (this.head == null) { this.head = obj; this.current = head; } else { if (current != null) { this.previousObjects.push(current); this.current.addJSONObject(obj); } this.current = obj; } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "startElement(String,String,String,org.xml.sax.Attributes)"); }
[ "public", "void", "startElement", "(", "String", "namespaceURI", ",", "String", "localName", ",", "String", "qName", ",", "Attributes", "attrs", ")", "throws", "SAXException", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "exiting", "(", "className", ",", "\"startElement(String,String,String,org.xml.sax.Attributes)\"", ")", ";", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "int", "attrLength", "=", "attrs", ".", "getLength", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "attrLength", ";", "i", "++", ")", "{", "props", ".", "put", "(", "attrs", ".", "getQName", "(", "i", ")", ",", "attrs", ".", "getValue", "(", "i", ")", ")", ";", "}", "JSONObject", "obj", "=", "new", "JSONObject", "(", "localName", ",", "props", ")", ";", "if", "(", "this", ".", "head", "==", "null", ")", "{", "this", ".", "head", "=", "obj", ";", "this", ".", "current", "=", "head", ";", "}", "else", "{", "if", "(", "current", "!=", "null", ")", "{", "this", ".", "previousObjects", ".", "push", "(", "current", ")", ";", "this", ".", "current", ".", "addJSONObject", "(", "obj", ")", ";", "}", "this", ".", "current", "=", "obj", ";", "}", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "exiting", "(", "className", ",", "\"startElement(String,String,String,org.xml.sax.Attributes)\"", ")", ";", "}" ]
This function parses an IFix top level element and all its children.
[ "This", "function", "parses", "an", "IFix", "top", "level", "element", "and", "all", "its", "children", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java#L100-L129
train
OpenLiberty/open-liberty
dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java
JSONSAXHandler.endElement
public void endElement(String uri, String localName, String qName) throws SAXException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "endElement(String,String,String)"); if (!previousObjects.isEmpty()) { this.current = (JSONObject)this.previousObjects.pop(); } else { this.current = null; } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "endElement(String,String,String)"); }
java
public void endElement(String uri, String localName, String qName) throws SAXException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "endElement(String,String,String)"); if (!previousObjects.isEmpty()) { this.current = (JSONObject)this.previousObjects.pop(); } else { this.current = null; } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "endElement(String,String,String)"); }
[ "public", "void", "endElement", "(", "String", "uri", ",", "String", "localName", ",", "String", "qName", ")", "throws", "SAXException", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "entering", "(", "className", ",", "\"endElement(String,String,String)\"", ")", ";", "if", "(", "!", "previousObjects", ".", "isEmpty", "(", ")", ")", "{", "this", ".", "current", "=", "(", "JSONObject", ")", "this", ".", "previousObjects", ".", "pop", "(", ")", ";", "}", "else", "{", "this", ".", "current", "=", "null", ";", "}", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "exiting", "(", "className", ",", "\"endElement(String,String,String)\"", ")", ";", "}" ]
Function ends a tag in this iFix parser.
[ "Function", "ends", "a", "tag", "in", "this", "iFix", "parser", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java#L134-L149
train
OpenLiberty/open-liberty
dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java
JSONSAXHandler.flushBuffer
public void flushBuffer() throws IOException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "flushBuffer()"); if (this.osWriter != null) { this.osWriter.flush(); } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "flushBuffer()"); }
java
public void flushBuffer() throws IOException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "flushBuffer()"); if (this.osWriter != null) { this.osWriter.flush(); } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "flushBuffer()"); }
[ "public", "void", "flushBuffer", "(", ")", "throws", "IOException", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "entering", "(", "className", ",", "\"flushBuffer()\"", ")", ";", "if", "(", "this", ".", "osWriter", "!=", "null", ")", "{", "this", ".", "osWriter", ".", "flush", "(", ")", ";", "}", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "exiting", "(", "className", ",", "\"flushBuffer()\"", ")", ";", "}" ]
Method to flush out anything remaining in the buffers.
[ "Method", "to", "flush", "out", "anything", "remaining", "in", "the", "buffers", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java#L190-L201
train
OpenLiberty/open-liberty
dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java
JSONSAXHandler.startJSON
private void startJSON() throws SAXException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "startJSON()"); this.head = new JSONObject("",null); this.current = head; if (logger.isLoggable(Level.FINER)) logger.exiting(className, "startJSON()"); }
java
private void startJSON() throws SAXException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "startJSON()"); this.head = new JSONObject("",null); this.current = head; if (logger.isLoggable(Level.FINER)) logger.exiting(className, "startJSON()"); }
[ "private", "void", "startJSON", "(", ")", "throws", "SAXException", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "entering", "(", "className", ",", "\"startJSON()\"", ")", ";", "this", ".", "head", "=", "new", "JSONObject", "(", "\"\"", ",", "null", ")", ";", "this", ".", "current", "=", "head", ";", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "exiting", "(", "className", ",", "\"startJSON()\"", ")", ";", "}" ]
Internal method to start JSON generation.
[ "Internal", "method", "to", "start", "JSON", "generation", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java#L206-L215
train
OpenLiberty/open-liberty
dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java
JSONSAXHandler.endJSON
private void endJSON() throws SAXException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "endJSON()"); try { this.head.writeObject(this.osWriter, 0, true, this.compact); this.head = null; this.current = null; this.previousObjects.clear(); } catch (Exception ex) { SAXException saxEx = new SAXException(ex); saxEx.initCause(ex); throw saxEx; } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "endJSON()"); }
java
private void endJSON() throws SAXException { if (logger.isLoggable(Level.FINER)) logger.entering(className, "endJSON()"); try { this.head.writeObject(this.osWriter, 0, true, this.compact); this.head = null; this.current = null; this.previousObjects.clear(); } catch (Exception ex) { SAXException saxEx = new SAXException(ex); saxEx.initCause(ex); throw saxEx; } if (logger.isLoggable(Level.FINER)) logger.exiting(className, "endJSON()"); }
[ "private", "void", "endJSON", "(", ")", "throws", "SAXException", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "entering", "(", "className", ",", "\"endJSON()\"", ")", ";", "try", "{", "this", ".", "head", ".", "writeObject", "(", "this", ".", "osWriter", ",", "0", ",", "true", ",", "this", ".", "compact", ")", ";", "this", ".", "head", "=", "null", ";", "this", ".", "current", "=", "null", ";", "this", ".", "previousObjects", ".", "clear", "(", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "SAXException", "saxEx", "=", "new", "SAXException", "(", "ex", ")", ";", "saxEx", ".", "initCause", "(", "ex", ")", ";", "throw", "saxEx", ";", "}", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINER", ")", ")", "logger", ".", "exiting", "(", "className", ",", "\"endJSON()\"", ")", ";", "}" ]
Internal method to end the JSON generation and to write out the resultant JSON text and reset the internal state of the hander.
[ "Internal", "method", "to", "end", "the", "JSON", "generation", "and", "to", "write", "out", "the", "resultant", "JSON", "text", "and", "reset", "the", "internal", "state", "of", "the", "hander", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONSAXHandler.java#L221-L241
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java
JmsJcaManagedConnectionFactoryImpl.matchManagedConnections
@Override final public ManagedConnection matchManagedConnections( final Set connectionSet, final Subject subject, final ConnectionRequestInfo requestInfo) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(TRACE, "matchManagedConnections", new Object[] { connectionSet, JmsJcaManagedConnection.subjectToString(subject), requestInfo }); } final SICoreConnection coreConnection = (requestInfo instanceof JmsJcaConnectionRequestInfo) ? ((JmsJcaConnectionRequestInfo) requestInfo) .getSICoreConnection() : null; final JmsJcaUserDetails userDetails = getUserDetails(subject, requestInfo); if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { if (userDetails != null) { SibTr.debug(TRACE, "Got a username and password"); } else { SibTr.debug(TRACE, "Using subject"); } } JmsJcaManagedConnection matchedConnection = null; // Go through the set of managed connections and try and match one for (final Iterator iterator = connectionSet.iterator(); iterator .hasNext();) { final Object object = iterator.next(); // Skip over any non JmsJcaManagedConnections if (object instanceof JmsJcaManagedConnection) { final JmsJcaManagedConnection managedConnection = (JmsJcaManagedConnection) object; // If we have a user name and password from either the // requestInfo or subject then we must try and match againgst // those if (userDetails != null) { if (managedConnection.match(userDetails, coreConnection)) { matchedConnection = managedConnection; if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr .debug(TRACE, "Matched a connection against the subject username and password"); } break; } } else { // This is a subject where we couldnt get the userName and // password from.. if (managedConnection.match(subject, coreConnection)) { matchedConnection = managedConnection; if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr.debug(TRACE, "Matched a connection against the subject"); } break; } } } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(TRACE, "matchManagedConnections", matchedConnection); } return matchedConnection; }
java
@Override final public ManagedConnection matchManagedConnections( final Set connectionSet, final Subject subject, final ConnectionRequestInfo requestInfo) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(TRACE, "matchManagedConnections", new Object[] { connectionSet, JmsJcaManagedConnection.subjectToString(subject), requestInfo }); } final SICoreConnection coreConnection = (requestInfo instanceof JmsJcaConnectionRequestInfo) ? ((JmsJcaConnectionRequestInfo) requestInfo) .getSICoreConnection() : null; final JmsJcaUserDetails userDetails = getUserDetails(subject, requestInfo); if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { if (userDetails != null) { SibTr.debug(TRACE, "Got a username and password"); } else { SibTr.debug(TRACE, "Using subject"); } } JmsJcaManagedConnection matchedConnection = null; // Go through the set of managed connections and try and match one for (final Iterator iterator = connectionSet.iterator(); iterator .hasNext();) { final Object object = iterator.next(); // Skip over any non JmsJcaManagedConnections if (object instanceof JmsJcaManagedConnection) { final JmsJcaManagedConnection managedConnection = (JmsJcaManagedConnection) object; // If we have a user name and password from either the // requestInfo or subject then we must try and match againgst // those if (userDetails != null) { if (managedConnection.match(userDetails, coreConnection)) { matchedConnection = managedConnection; if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr .debug(TRACE, "Matched a connection against the subject username and password"); } break; } } else { // This is a subject where we couldnt get the userName and // password from.. if (managedConnection.match(subject, coreConnection)) { matchedConnection = managedConnection; if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr.debug(TRACE, "Matched a connection against the subject"); } break; } } } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(TRACE, "matchManagedConnections", matchedConnection); } return matchedConnection; }
[ "@", "Override", "final", "public", "ManagedConnection", "matchManagedConnections", "(", "final", "Set", "connectionSet", ",", "final", "Subject", "subject", ",", "final", "ConnectionRequestInfo", "requestInfo", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "TRACE", ",", "\"matchManagedConnections\"", ",", "new", "Object", "[", "]", "{", "connectionSet", ",", "JmsJcaManagedConnection", ".", "subjectToString", "(", "subject", ")", ",", "requestInfo", "}", ")", ";", "}", "final", "SICoreConnection", "coreConnection", "=", "(", "requestInfo", "instanceof", "JmsJcaConnectionRequestInfo", ")", "?", "(", "(", "JmsJcaConnectionRequestInfo", ")", "requestInfo", ")", ".", "getSICoreConnection", "(", ")", ":", "null", ";", "final", "JmsJcaUserDetails", "userDetails", "=", "getUserDetails", "(", "subject", ",", "requestInfo", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isDebugEnabled", "(", ")", ")", "{", "if", "(", "userDetails", "!=", "null", ")", "{", "SibTr", ".", "debug", "(", "TRACE", ",", "\"Got a username and password\"", ")", ";", "}", "else", "{", "SibTr", ".", "debug", "(", "TRACE", ",", "\"Using subject\"", ")", ";", "}", "}", "JmsJcaManagedConnection", "matchedConnection", "=", "null", ";", "// Go through the set of managed connections and try and match one", "for", "(", "final", "Iterator", "iterator", "=", "connectionSet", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "final", "Object", "object", "=", "iterator", ".", "next", "(", ")", ";", "// Skip over any non JmsJcaManagedConnections", "if", "(", "object", "instanceof", "JmsJcaManagedConnection", ")", "{", "final", "JmsJcaManagedConnection", "managedConnection", "=", "(", "JmsJcaManagedConnection", ")", "object", ";", "// If we have a user name and password from either the", "// requestInfo or subject then we must try and match againgst", "// those", "if", "(", "userDetails", "!=", "null", ")", "{", "if", "(", "managedConnection", ".", "match", "(", "userDetails", ",", "coreConnection", ")", ")", "{", "matchedConnection", "=", "managedConnection", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isDebugEnabled", "(", ")", ")", "{", "SibTr", ".", "debug", "(", "TRACE", ",", "\"Matched a connection against the subject username and password\"", ")", ";", "}", "break", ";", "}", "}", "else", "{", "// This is a subject where we couldnt get the userName and", "// password from..", "if", "(", "managedConnection", ".", "match", "(", "subject", ",", "coreConnection", ")", ")", "{", "matchedConnection", "=", "managedConnection", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isDebugEnabled", "(", ")", ")", "{", "SibTr", ".", "debug", "(", "TRACE", ",", "\"Matched a connection against the subject\"", ")", ";", "}", "break", ";", "}", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "TRACE", ",", "\"matchManagedConnections\"", ",", "matchedConnection", ")", ";", "}", "return", "matchedConnection", ";", "}" ]
Returns a matching connection from the candidate set of connections. @param connectionSet the candidate set of connections @param subject the subject @param requestInfo the request information @return the matching connection, if any
[ "Returns", "a", "matching", "connection", "from", "the", "candidate", "set", "of", "connections", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java#L508-L593
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java
JmsJcaManagedConnectionFactoryImpl.getTrmProperties
Map getTrmProperties() { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getTrmProperties"); } final Map trmProperties = new HashMap(); final String trmBusName = getBusName(); if ((trmBusName != null) && (!trmBusName.equals(""))) { trmProperties.put(SibTrmConstants.BUSNAME, trmBusName); } final String trmTarget = getTarget(); if ((trmTarget != null) && (!trmTarget.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_GROUP, trmTarget); } final String trmTargetType = getTargetType(); if ((trmTargetType != null) && (!trmTargetType.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_TYPE, trmTargetType); } final String trmTargetSignificance = getTargetSignificance(); if ((trmTargetSignificance != null) && (!trmTargetSignificance.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_SIGNIFICANCE, trmTargetSignificance); } final String trmTargetTransportChain = getTargetTransportChain(); if ((trmTargetTransportChain != null) && (!trmTargetTransportChain.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_TRANSPORT_CHAIN, trmTargetTransportChain); } final String trmProviderEndpoints = getRemoteServerAddress(); if ((trmProviderEndpoints != null) && (!trmProviderEndpoints.equals(""))) { trmProperties.put(SibTrmConstants.PROVIDER_ENDPOINTS, trmProviderEndpoints); } final String trmTargetTransport = getTargetTransport(); if ((trmTargetTransport != null) && (!trmTargetTransport.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_TRANSPORT_TYPE, trmTargetTransport); } final String trmConnectionProximity = getConnectionProximity(); if ((trmConnectionProximity != null) && (!trmConnectionProximity.equals(""))) { trmProperties.put(SibTrmConstants.CONNECTION_PROXIMITY, trmConnectionProximity); } final String trmSubscriptionProtocol = getSubscriptionProtocol(); if ((trmSubscriptionProtocol != null) && (!trmSubscriptionProtocol.equals(""))) { trmProperties.put(SibTrmConstants.SUBSCRIPTION_PROTOCOL, trmSubscriptionProtocol); } final String trmMulticastInterface = getMulticastInterface(); if ((trmMulticastInterface != null) && (!trmMulticastInterface.equals(""))) { trmProperties.put(SibTrmConstants.MULTICAST_INTERFACE, trmMulticastInterface); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "getTrmProperties", trmProperties); } return trmProperties; }
java
Map getTrmProperties() { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getTrmProperties"); } final Map trmProperties = new HashMap(); final String trmBusName = getBusName(); if ((trmBusName != null) && (!trmBusName.equals(""))) { trmProperties.put(SibTrmConstants.BUSNAME, trmBusName); } final String trmTarget = getTarget(); if ((trmTarget != null) && (!trmTarget.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_GROUP, trmTarget); } final String trmTargetType = getTargetType(); if ((trmTargetType != null) && (!trmTargetType.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_TYPE, trmTargetType); } final String trmTargetSignificance = getTargetSignificance(); if ((trmTargetSignificance != null) && (!trmTargetSignificance.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_SIGNIFICANCE, trmTargetSignificance); } final String trmTargetTransportChain = getTargetTransportChain(); if ((trmTargetTransportChain != null) && (!trmTargetTransportChain.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_TRANSPORT_CHAIN, trmTargetTransportChain); } final String trmProviderEndpoints = getRemoteServerAddress(); if ((trmProviderEndpoints != null) && (!trmProviderEndpoints.equals(""))) { trmProperties.put(SibTrmConstants.PROVIDER_ENDPOINTS, trmProviderEndpoints); } final String trmTargetTransport = getTargetTransport(); if ((trmTargetTransport != null) && (!trmTargetTransport.equals(""))) { trmProperties.put(SibTrmConstants.TARGET_TRANSPORT_TYPE, trmTargetTransport); } final String trmConnectionProximity = getConnectionProximity(); if ((trmConnectionProximity != null) && (!trmConnectionProximity.equals(""))) { trmProperties.put(SibTrmConstants.CONNECTION_PROXIMITY, trmConnectionProximity); } final String trmSubscriptionProtocol = getSubscriptionProtocol(); if ((trmSubscriptionProtocol != null) && (!trmSubscriptionProtocol.equals(""))) { trmProperties.put(SibTrmConstants.SUBSCRIPTION_PROTOCOL, trmSubscriptionProtocol); } final String trmMulticastInterface = getMulticastInterface(); if ((trmMulticastInterface != null) && (!trmMulticastInterface.equals(""))) { trmProperties.put(SibTrmConstants.MULTICAST_INTERFACE, trmMulticastInterface); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "getTrmProperties", trmProperties); } return trmProperties; }
[ "Map", "getTrmProperties", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "TRACE", ",", "\"getTrmProperties\"", ")", ";", "}", "final", "Map", "trmProperties", "=", "new", "HashMap", "(", ")", ";", "final", "String", "trmBusName", "=", "getBusName", "(", ")", ";", "if", "(", "(", "trmBusName", "!=", "null", ")", "&&", "(", "!", "trmBusName", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "BUSNAME", ",", "trmBusName", ")", ";", "}", "final", "String", "trmTarget", "=", "getTarget", "(", ")", ";", "if", "(", "(", "trmTarget", "!=", "null", ")", "&&", "(", "!", "trmTarget", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "TARGET_GROUP", ",", "trmTarget", ")", ";", "}", "final", "String", "trmTargetType", "=", "getTargetType", "(", ")", ";", "if", "(", "(", "trmTargetType", "!=", "null", ")", "&&", "(", "!", "trmTargetType", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "TARGET_TYPE", ",", "trmTargetType", ")", ";", "}", "final", "String", "trmTargetSignificance", "=", "getTargetSignificance", "(", ")", ";", "if", "(", "(", "trmTargetSignificance", "!=", "null", ")", "&&", "(", "!", "trmTargetSignificance", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "TARGET_SIGNIFICANCE", ",", "trmTargetSignificance", ")", ";", "}", "final", "String", "trmTargetTransportChain", "=", "getTargetTransportChain", "(", ")", ";", "if", "(", "(", "trmTargetTransportChain", "!=", "null", ")", "&&", "(", "!", "trmTargetTransportChain", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "TARGET_TRANSPORT_CHAIN", ",", "trmTargetTransportChain", ")", ";", "}", "final", "String", "trmProviderEndpoints", "=", "getRemoteServerAddress", "(", ")", ";", "if", "(", "(", "trmProviderEndpoints", "!=", "null", ")", "&&", "(", "!", "trmProviderEndpoints", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "PROVIDER_ENDPOINTS", ",", "trmProviderEndpoints", ")", ";", "}", "final", "String", "trmTargetTransport", "=", "getTargetTransport", "(", ")", ";", "if", "(", "(", "trmTargetTransport", "!=", "null", ")", "&&", "(", "!", "trmTargetTransport", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "TARGET_TRANSPORT_TYPE", ",", "trmTargetTransport", ")", ";", "}", "final", "String", "trmConnectionProximity", "=", "getConnectionProximity", "(", ")", ";", "if", "(", "(", "trmConnectionProximity", "!=", "null", ")", "&&", "(", "!", "trmConnectionProximity", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "CONNECTION_PROXIMITY", ",", "trmConnectionProximity", ")", ";", "}", "final", "String", "trmSubscriptionProtocol", "=", "getSubscriptionProtocol", "(", ")", ";", "if", "(", "(", "trmSubscriptionProtocol", "!=", "null", ")", "&&", "(", "!", "trmSubscriptionProtocol", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "SUBSCRIPTION_PROTOCOL", ",", "trmSubscriptionProtocol", ")", ";", "}", "final", "String", "trmMulticastInterface", "=", "getMulticastInterface", "(", ")", ";", "if", "(", "(", "trmMulticastInterface", "!=", "null", ")", "&&", "(", "!", "trmMulticastInterface", ".", "equals", "(", "\"\"", ")", ")", ")", "{", "trmProperties", ".", "put", "(", "SibTrmConstants", ".", "MULTICAST_INTERFACE", ",", "trmMulticastInterface", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "this", ",", "TRACE", ",", "\"getTrmProperties\"", ",", "trmProperties", ")", ";", "}", "return", "trmProperties", ";", "}" ]
Returns the map of properties required by TRM. @return the map of TRM properties
[ "Returns", "the", "map", "of", "properties", "required", "by", "TRM", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java#L1567-L1644
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java
JmsJcaManagedConnectionFactoryImpl.getReference
Reference getReference() { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getReference"); } // Create a reference object describing this class final Reference reference = new Reference(getConnectionType(), getClass().getName(), null); // Make sure no-one can pull the rug from beneath us. synchronized (_properties) { // Convert the map of properties into an encoded form, where the // keys have the necessary prefix on the front, and the values are // all Strings. final Map encodedMap = JmsJcaReferenceUtils.getInstance() .getStringEncodedMap(_properties, defaultJNDIProperties); // Now turn the encoded map into the reference items. for (final Iterator iterator = encodedMap.entrySet().iterator(); iterator .hasNext();) { final Map.Entry entry = (Map.Entry) iterator.next(); final String prefixedKey = (String) entry.getKey(); final String stringForm = (String) entry.getValue(); // Store the prefixed key and value in string form. reference.add(new StringRefAddr(prefixedKey, stringForm)); } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(TRACE, "getReference", reference); } return reference; }
java
Reference getReference() { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getReference"); } // Create a reference object describing this class final Reference reference = new Reference(getConnectionType(), getClass().getName(), null); // Make sure no-one can pull the rug from beneath us. synchronized (_properties) { // Convert the map of properties into an encoded form, where the // keys have the necessary prefix on the front, and the values are // all Strings. final Map encodedMap = JmsJcaReferenceUtils.getInstance() .getStringEncodedMap(_properties, defaultJNDIProperties); // Now turn the encoded map into the reference items. for (final Iterator iterator = encodedMap.entrySet().iterator(); iterator .hasNext();) { final Map.Entry entry = (Map.Entry) iterator.next(); final String prefixedKey = (String) entry.getKey(); final String stringForm = (String) entry.getValue(); // Store the prefixed key and value in string form. reference.add(new StringRefAddr(prefixedKey, stringForm)); } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(TRACE, "getReference", reference); } return reference; }
[ "Reference", "getReference", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "TRACE", ",", "\"getReference\"", ")", ";", "}", "// Create a reference object describing this class", "final", "Reference", "reference", "=", "new", "Reference", "(", "getConnectionType", "(", ")", ",", "getClass", "(", ")", ".", "getName", "(", ")", ",", "null", ")", ";", "// Make sure no-one can pull the rug from beneath us.", "synchronized", "(", "_properties", ")", "{", "// Convert the map of properties into an encoded form, where the", "// keys have the necessary prefix on the front, and the values are", "// all Strings.", "final", "Map", "encodedMap", "=", "JmsJcaReferenceUtils", ".", "getInstance", "(", ")", ".", "getStringEncodedMap", "(", "_properties", ",", "defaultJNDIProperties", ")", ";", "// Now turn the encoded map into the reference items.", "for", "(", "final", "Iterator", "iterator", "=", "encodedMap", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "final", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iterator", ".", "next", "(", ")", ";", "final", "String", "prefixedKey", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "final", "String", "stringForm", "=", "(", "String", ")", "entry", ".", "getValue", "(", ")", ";", "// Store the prefixed key and value in string form.", "reference", ".", "add", "(", "new", "StringRefAddr", "(", "prefixedKey", ",", "stringForm", ")", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "TRACE", ",", "\"getReference\"", ",", "reference", ")", ";", "}", "return", "reference", ";", "}" ]
Returns a reference for this managed connection factory. @return a reference for this managed connection factory
[ "Returns", "a", "reference", "for", "this", "managed", "connection", "factory", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java#L1779-L1818
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java
JmsJcaManagedConnectionFactoryImpl.setReference
public void setReference(final Reference reference) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "setReference", reference); } // Make sure no-one can pull the rug from beneath us. synchronized (_properties) { _properties = JmsJcaReferenceUtils.getInstance() .getMapFromReference(reference, defaultJNDIProperties); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "setReference"); } }
java
public void setReference(final Reference reference) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "setReference", reference); } // Make sure no-one can pull the rug from beneath us. synchronized (_properties) { _properties = JmsJcaReferenceUtils.getInstance() .getMapFromReference(reference, defaultJNDIProperties); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "setReference"); } }
[ "public", "void", "setReference", "(", "final", "Reference", "reference", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "TRACE", ",", "\"setReference\"", ",", "reference", ")", ";", "}", "// Make sure no-one can pull the rug from beneath us.", "synchronized", "(", "_properties", ")", "{", "_properties", "=", "JmsJcaReferenceUtils", ".", "getInstance", "(", ")", ".", "getMapFromReference", "(", "reference", ",", "defaultJNDIProperties", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "this", ",", "TRACE", ",", "\"setReference\"", ")", ";", "}", "}" ]
Initializes this managed connection factory using the given reference. @param reference the reference
[ "Initializes", "this", "managed", "connection", "factory", "using", "the", "given", "reference", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java#L1826-L1842
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java
JmsJcaManagedConnectionFactoryImpl.getObjectInstance
@Override public Object getObjectInstance(final Object object, final Name name, final Context context, final Hashtable environment) throws Exception { JmsConnectionFactory jmsConnectionFactory = null; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getObjectInstance", new Object[] { object, name, context, environment }); } if (object instanceof Reference) { final Reference reference = (Reference) object; final String clsName = reference.getClassName(); if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr.debug(this, TRACE, "class name is " + clsName); } if ((JmsJcaManagedConnectionFactoryImpl.CONN_FACTORY_TYPE .equals(clsName)) || (JmsJcaManagedQueueConnectionFactoryImpl.QUEUE_CONN_FACTORY_TYPE .equals(clsName)) || (JmsJcaManagedTopicConnectionFactoryImpl.TOPIC_CONN_FACTORY_TYPE .equals(clsName))) { try { jmsConnectionFactory = (JmsConnectionFactory) createConnectionFactory(); jmsConnectionFactory.setReference(reference); } catch (final ResourceException exception) { FFDCFilter.processException(exception, CLASS_NAME + "getObjectInstance", FFDC_PROBE_6, this); throw new ResourceAdapterInternalException(NLS .getFormattedMessage( "EXCEPTION_RECEIVED_CWSJR1027", new Object[] { exception, "getObjectInstance" }, null), exception); } } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "getObjectInstance", jmsConnectionFactory); } return jmsConnectionFactory; }
java
@Override public Object getObjectInstance(final Object object, final Name name, final Context context, final Hashtable environment) throws Exception { JmsConnectionFactory jmsConnectionFactory = null; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getObjectInstance", new Object[] { object, name, context, environment }); } if (object instanceof Reference) { final Reference reference = (Reference) object; final String clsName = reference.getClassName(); if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) { SibTr.debug(this, TRACE, "class name is " + clsName); } if ((JmsJcaManagedConnectionFactoryImpl.CONN_FACTORY_TYPE .equals(clsName)) || (JmsJcaManagedQueueConnectionFactoryImpl.QUEUE_CONN_FACTORY_TYPE .equals(clsName)) || (JmsJcaManagedTopicConnectionFactoryImpl.TOPIC_CONN_FACTORY_TYPE .equals(clsName))) { try { jmsConnectionFactory = (JmsConnectionFactory) createConnectionFactory(); jmsConnectionFactory.setReference(reference); } catch (final ResourceException exception) { FFDCFilter.processException(exception, CLASS_NAME + "getObjectInstance", FFDC_PROBE_6, this); throw new ResourceAdapterInternalException(NLS .getFormattedMessage( "EXCEPTION_RECEIVED_CWSJR1027", new Object[] { exception, "getObjectInstance" }, null), exception); } } } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "getObjectInstance", jmsConnectionFactory); } return jmsConnectionFactory; }
[ "@", "Override", "public", "Object", "getObjectInstance", "(", "final", "Object", "object", ",", "final", "Name", "name", ",", "final", "Context", "context", ",", "final", "Hashtable", "environment", ")", "throws", "Exception", "{", "JmsConnectionFactory", "jmsConnectionFactory", "=", "null", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "TRACE", ",", "\"getObjectInstance\"", ",", "new", "Object", "[", "]", "{", "object", ",", "name", ",", "context", ",", "environment", "}", ")", ";", "}", "if", "(", "object", "instanceof", "Reference", ")", "{", "final", "Reference", "reference", "=", "(", "Reference", ")", "object", ";", "final", "String", "clsName", "=", "reference", ".", "getClassName", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isDebugEnabled", "(", ")", ")", "{", "SibTr", ".", "debug", "(", "this", ",", "TRACE", ",", "\"class name is \"", "+", "clsName", ")", ";", "}", "if", "(", "(", "JmsJcaManagedConnectionFactoryImpl", ".", "CONN_FACTORY_TYPE", ".", "equals", "(", "clsName", ")", ")", "||", "(", "JmsJcaManagedQueueConnectionFactoryImpl", ".", "QUEUE_CONN_FACTORY_TYPE", ".", "equals", "(", "clsName", ")", ")", "||", "(", "JmsJcaManagedTopicConnectionFactoryImpl", ".", "TOPIC_CONN_FACTORY_TYPE", ".", "equals", "(", "clsName", ")", ")", ")", "{", "try", "{", "jmsConnectionFactory", "=", "(", "JmsConnectionFactory", ")", "createConnectionFactory", "(", ")", ";", "jmsConnectionFactory", ".", "setReference", "(", "reference", ")", ";", "}", "catch", "(", "final", "ResourceException", "exception", ")", "{", "FFDCFilter", ".", "processException", "(", "exception", ",", "CLASS_NAME", "+", "\"getObjectInstance\"", ",", "FFDC_PROBE_6", ",", "this", ")", ";", "throw", "new", "ResourceAdapterInternalException", "(", "NLS", ".", "getFormattedMessage", "(", "\"EXCEPTION_RECEIVED_CWSJR1027\"", ",", "new", "Object", "[", "]", "{", "exception", ",", "\"getObjectInstance\"", "}", ",", "null", ")", ",", "exception", ")", ";", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exit", "(", "this", ",", "TRACE", ",", "\"getObjectInstance\"", ",", "jmsConnectionFactory", ")", ";", "}", "return", "jmsConnectionFactory", ";", "}" ]
Constructs an object factory which constructs a managed connection factory, calls the non-managed createConnectionFactory and then calls the setReference on the JMSConnFactory. @param object the referenceable object to be created @param name the name @param context the naming context @param environment the environment @return a JmsConnectionFactory or null if it could not obtain one.
[ "Constructs", "an", "object", "factory", "which", "constructs", "a", "managed", "connection", "factory", "calls", "the", "non", "-", "managed", "createConnectionFactory", "and", "then", "calls", "the", "setReference", "on", "the", "JMSConnFactory", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaManagedConnectionFactoryImpl.java#L1859-L1913
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsTraceRouterImpl.java
WsTraceRouterImpl.setWsTraceHandler
public void setWsTraceHandler(String id, WsTraceHandler ref) { if (id != null && ref != null) { RERWLOCK.writeLock().lock(); try { wsTraceHandlerServices.put(id, ref); /* * Route prev traces to the new LogHandler. * * This is primarily for solving the problem during server init where the WsTraceRouterImpl * is registered *after* we've already issued some early startup traces. We cache * these early traces in the "earlierTraces" queue in BaseTraceService, which then * passes them to WsTraceRouterImpl once it's registered. */ if (earlierTraces == null) { return; } for (RoutedMessage earlierTrace : earlierTraces.toArray(new RoutedMessage[earlierTraces.size()])) { if (earlierTrace != null) { routeTo(earlierTrace, id); } } } finally { RERWLOCK.writeLock().unlock(); } } }
java
public void setWsTraceHandler(String id, WsTraceHandler ref) { if (id != null && ref != null) { RERWLOCK.writeLock().lock(); try { wsTraceHandlerServices.put(id, ref); /* * Route prev traces to the new LogHandler. * * This is primarily for solving the problem during server init where the WsTraceRouterImpl * is registered *after* we've already issued some early startup traces. We cache * these early traces in the "earlierTraces" queue in BaseTraceService, which then * passes them to WsTraceRouterImpl once it's registered. */ if (earlierTraces == null) { return; } for (RoutedMessage earlierTrace : earlierTraces.toArray(new RoutedMessage[earlierTraces.size()])) { if (earlierTrace != null) { routeTo(earlierTrace, id); } } } finally { RERWLOCK.writeLock().unlock(); } } }
[ "public", "void", "setWsTraceHandler", "(", "String", "id", ",", "WsTraceHandler", "ref", ")", "{", "if", "(", "id", "!=", "null", "&&", "ref", "!=", "null", ")", "{", "RERWLOCK", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "wsTraceHandlerServices", ".", "put", "(", "id", ",", "ref", ")", ";", "/*\n * Route prev traces to the new LogHandler.\n *\n * This is primarily for solving the problem during server init where the WsTraceRouterImpl\n * is registered *after* we've already issued some early startup traces. We cache\n * these early traces in the \"earlierTraces\" queue in BaseTraceService, which then\n * passes them to WsTraceRouterImpl once it's registered.\n */", "if", "(", "earlierTraces", "==", "null", ")", "{", "return", ";", "}", "for", "(", "RoutedMessage", "earlierTrace", ":", "earlierTraces", ".", "toArray", "(", "new", "RoutedMessage", "[", "earlierTraces", ".", "size", "(", ")", "]", ")", ")", "{", "if", "(", "earlierTrace", "!=", "null", ")", "{", "routeTo", "(", "earlierTrace", ",", "id", ")", ";", "}", "}", "}", "finally", "{", "RERWLOCK", ".", "writeLock", "(", ")", ".", "unlock", "(", ")", ";", "}", "}", "}" ]
Add the wsTraceHandler ref. 1 or more LogHandlers may be set.
[ "Add", "the", "wsTraceHandler", "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/WsTraceRouterImpl.java#L67-L93
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsTraceRouterImpl.java
WsTraceRouterImpl.routeToAll
protected boolean routeToAll(RoutedMessage routedTrace, Set<String> logHandlerIds) { for (String logHandlerId : logHandlerIds) { routeTo(routedTrace, logHandlerId); } return true; //for now return true. Later we might have a config/flag to check whether to log normally or not. }
java
protected boolean routeToAll(RoutedMessage routedTrace, Set<String> logHandlerIds) { for (String logHandlerId : logHandlerIds) { routeTo(routedTrace, logHandlerId); } return true; //for now return true. Later we might have a config/flag to check whether to log normally or not. }
[ "protected", "boolean", "routeToAll", "(", "RoutedMessage", "routedTrace", ",", "Set", "<", "String", ">", "logHandlerIds", ")", "{", "for", "(", "String", "logHandlerId", ":", "logHandlerIds", ")", "{", "routeTo", "(", "routedTrace", ",", "logHandlerId", ")", ";", "}", "return", "true", ";", "//for now return true. Later we might have a config/flag to check whether to log normally or not.", "}" ]
Route the trace to all LogHandlers in the set. @return true if the set contained DEFAULT, which means the msg should be logged normally as well. false otherwise.
[ "Route", "the", "trace", "to", "all", "LogHandlers", "in", "the", "set", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsTraceRouterImpl.java#L136-L143
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsTraceRouterImpl.java
WsTraceRouterImpl.routeTo
protected void routeTo(RoutedMessage routedTrace, String logHandlerId) { WsTraceHandler wsTraceHandler = wsTraceHandlerServices.get(logHandlerId); if (wsTraceHandler != null) { wsTraceHandler.publish(routedTrace); } }
java
protected void routeTo(RoutedMessage routedTrace, String logHandlerId) { WsTraceHandler wsTraceHandler = wsTraceHandlerServices.get(logHandlerId); if (wsTraceHandler != null) { wsTraceHandler.publish(routedTrace); } }
[ "protected", "void", "routeTo", "(", "RoutedMessage", "routedTrace", ",", "String", "logHandlerId", ")", "{", "WsTraceHandler", "wsTraceHandler", "=", "wsTraceHandlerServices", ".", "get", "(", "logHandlerId", ")", ";", "if", "(", "wsTraceHandler", "!=", "null", ")", "{", "wsTraceHandler", ".", "publish", "(", "routedTrace", ")", ";", "}", "}" ]
Route the traces to the LogHandler identified by the given logHandlerId. @param msg The fully formatted trace. @param logRecord The associated LogRecord, in case the LogHandler needs it. @param logHandlerId The LogHandler ID in which to route.
[ "Route", "the", "traces", "to", "the", "LogHandler", "identified", "by", "the", "given", "logHandlerId", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsTraceRouterImpl.java#L152-L157
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java
MatchingImpl.createMatchSpace
public MatchSpace createMatchSpace(Identifier rootId, boolean enableCacheing) { MatchSpace matchSpace = new MatchSpaceImpl(rootId, enableCacheing); return matchSpace; }
java
public MatchSpace createMatchSpace(Identifier rootId, boolean enableCacheing) { MatchSpace matchSpace = new MatchSpaceImpl(rootId, enableCacheing); return matchSpace; }
[ "public", "MatchSpace", "createMatchSpace", "(", "Identifier", "rootId", ",", "boolean", "enableCacheing", ")", "{", "MatchSpace", "matchSpace", "=", "new", "MatchSpaceImpl", "(", "rootId", ",", "enableCacheing", ")", ";", "return", "matchSpace", ";", "}" ]
Create a concrete instance of a MatchSpace
[ "Create", "a", "concrete", "instance", "of", "a", "MatchSpace" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java#L99-L104
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java
MatchingImpl.createOperator
public Operator createOperator(int op, Selector operand) { Operator operator = new OperatorImpl(op, operand); return operator; }
java
public Operator createOperator(int op, Selector operand) { Operator operator = new OperatorImpl(op, operand); return operator; }
[ "public", "Operator", "createOperator", "(", "int", "op", ",", "Selector", "operand", ")", "{", "Operator", "operator", "=", "new", "OperatorImpl", "(", "op", ",", "operand", ")", ";", "return", "operator", ";", "}" ]
Create a concrete instance of an Operator
[ "Create", "a", "concrete", "instance", "of", "an", "Operator" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java#L268-L273
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java
MatchingImpl.createLikeOperator
public Operator createLikeOperator(Selector ar, String pattern, boolean escaped, char escape) { Object parsed = Pattern.parsePattern(pattern, escaped, escape); if (parsed == null) return null; else if (parsed == Pattern.matchMany) return createOperator(Selector.NOT, createOperator(Selector.ISNULL, ar)); else if (parsed instanceof String) return createOperator(Selector.EQ, ar, createLiteral(parsed)); else return new LikeOperatorImpl(Selector.LIKE, ar, (Pattern) parsed, pattern, escaped, escape); }
java
public Operator createLikeOperator(Selector ar, String pattern, boolean escaped, char escape) { Object parsed = Pattern.parsePattern(pattern, escaped, escape); if (parsed == null) return null; else if (parsed == Pattern.matchMany) return createOperator(Selector.NOT, createOperator(Selector.ISNULL, ar)); else if (parsed instanceof String) return createOperator(Selector.EQ, ar, createLiteral(parsed)); else return new LikeOperatorImpl(Selector.LIKE, ar, (Pattern) parsed, pattern, escaped, escape); }
[ "public", "Operator", "createLikeOperator", "(", "Selector", "ar", ",", "String", "pattern", ",", "boolean", "escaped", ",", "char", "escape", ")", "{", "Object", "parsed", "=", "Pattern", ".", "parsePattern", "(", "pattern", ",", "escaped", ",", "escape", ")", ";", "if", "(", "parsed", "==", "null", ")", "return", "null", ";", "else", "if", "(", "parsed", "==", "Pattern", ".", "matchMany", ")", "return", "createOperator", "(", "Selector", ".", "NOT", ",", "createOperator", "(", "Selector", ".", "ISNULL", ",", "ar", ")", ")", ";", "else", "if", "(", "parsed", "instanceof", "String", ")", "return", "createOperator", "(", "Selector", ".", "EQ", ",", "ar", ",", "createLiteral", "(", "parsed", ")", ")", ";", "else", "return", "new", "LikeOperatorImpl", "(", "Selector", ".", "LIKE", ",", "ar", ",", "(", "Pattern", ")", "parsed", ",", "pattern", ",", "escaped", ",", "escape", ")", ";", "}" ]
Create a concrete instance of a LikeOperator
[ "Create", "a", "concrete", "instance", "of", "a", "LikeOperator" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchingImpl.java#L301-L313
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/RequestUtils.java
RequestUtils.getURIForCurrentDispatch
public static String getURIForCurrentDispatch (HttpServletRequest req){ String includeURI = (String) req.getAttribute(WebAppRequestDispatcher.REQUEST_URI_INCLUDE_ATTR); if (includeURI == null) return req.getRequestURI(); else return includeURI; }
java
public static String getURIForCurrentDispatch (HttpServletRequest req){ String includeURI = (String) req.getAttribute(WebAppRequestDispatcher.REQUEST_URI_INCLUDE_ATTR); if (includeURI == null) return req.getRequestURI(); else return includeURI; }
[ "public", "static", "String", "getURIForCurrentDispatch", "(", "HttpServletRequest", "req", ")", "{", "String", "includeURI", "=", "(", "String", ")", "req", ".", "getAttribute", "(", "WebAppRequestDispatcher", ".", "REQUEST_URI_INCLUDE_ATTR", ")", ";", "if", "(", "includeURI", "==", "null", ")", "return", "req", ".", "getRequestURI", "(", ")", ";", "else", "return", "includeURI", ";", "}" ]
Used to retrive the "true" uri that represents the current request. If include request_uri attribute is set, it returns that value. Otherwise, it returns the default of req.getRequestUri @param req @return
[ "Used", "to", "retrive", "the", "true", "uri", "that", "represents", "the", "current", "request", ".", "If", "include", "request_uri", "attribute", "is", "set", "it", "returns", "that", "value", ".", "Otherwise", "it", "returns", "the", "default", "of", "req", ".", "getRequestUri" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/RequestUtils.java#L657-L663
train
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java
RuntimeJobExecution.publishEvent
private void publishEvent(WSJobInstance objectToPublish, String eventToPublish) { if (getBatchEventsPublisher() != null) { getBatchEventsPublisher().publishJobInstanceEvent(objectToPublish, eventToPublish, correlationId); } }
java
private void publishEvent(WSJobInstance objectToPublish, String eventToPublish) { if (getBatchEventsPublisher() != null) { getBatchEventsPublisher().publishJobInstanceEvent(objectToPublish, eventToPublish, correlationId); } }
[ "private", "void", "publishEvent", "(", "WSJobInstance", "objectToPublish", ",", "String", "eventToPublish", ")", "{", "if", "(", "getBatchEventsPublisher", "(", ")", "!=", "null", ")", "{", "getBatchEventsPublisher", "(", ")", ".", "publishJobInstanceEvent", "(", "objectToPublish", ",", "eventToPublish", ",", "correlationId", ")", ";", "}", "}" ]
Publish event for this job instance @param jobInstance @param eventToBePublished
[ "Publish", "event", "for", "this", "job", "instance" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java#L150-L155
train
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java
RuntimeJobExecution.publishEvent
private void publishEvent(WSJobExecution execution, WSJobInstance jobInstance, BatchStatus batchStatus) { if (batchStatus == BatchStatus.FAILED) { publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_FAILED); publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_FAILED); } else if (batchStatus == BatchStatus.COMPLETED) { publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_COMPLETED); publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_COMPLETED); } else if (batchStatus == BatchStatus.STOPPED) { publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPED); publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPED); //smf call to go here, eventually } else if (batchStatus == BatchStatus.STOPPING) { publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPING); publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPING); } else if (batchStatus == BatchStatus.STARTED) { publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_DISPATCHED); publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STARTED); } }
java
private void publishEvent(WSJobExecution execution, WSJobInstance jobInstance, BatchStatus batchStatus) { if (batchStatus == BatchStatus.FAILED) { publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_FAILED); publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_FAILED); } else if (batchStatus == BatchStatus.COMPLETED) { publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_COMPLETED); publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_COMPLETED); } else if (batchStatus == BatchStatus.STOPPED) { publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPED); publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPED); //smf call to go here, eventually } else if (batchStatus == BatchStatus.STOPPING) { publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_STOPPING); publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STOPPING); } else if (batchStatus == BatchStatus.STARTED) { publishEvent(jobInstance, BatchEventsPublisher.TOPIC_INSTANCE_DISPATCHED); publishEvent(execution, BatchEventsPublisher.TOPIC_EXECUTION_STARTED); } }
[ "private", "void", "publishEvent", "(", "WSJobExecution", "execution", ",", "WSJobInstance", "jobInstance", ",", "BatchStatus", "batchStatus", ")", "{", "if", "(", "batchStatus", "==", "BatchStatus", ".", "FAILED", ")", "{", "publishEvent", "(", "execution", ",", "BatchEventsPublisher", ".", "TOPIC_EXECUTION_FAILED", ")", ";", "publishEvent", "(", "jobInstance", ",", "BatchEventsPublisher", ".", "TOPIC_INSTANCE_FAILED", ")", ";", "}", "else", "if", "(", "batchStatus", "==", "BatchStatus", ".", "COMPLETED", ")", "{", "publishEvent", "(", "execution", ",", "BatchEventsPublisher", ".", "TOPIC_EXECUTION_COMPLETED", ")", ";", "publishEvent", "(", "jobInstance", ",", "BatchEventsPublisher", ".", "TOPIC_INSTANCE_COMPLETED", ")", ";", "}", "else", "if", "(", "batchStatus", "==", "BatchStatus", ".", "STOPPED", ")", "{", "publishEvent", "(", "execution", ",", "BatchEventsPublisher", ".", "TOPIC_EXECUTION_STOPPED", ")", ";", "publishEvent", "(", "jobInstance", ",", "BatchEventsPublisher", ".", "TOPIC_INSTANCE_STOPPED", ")", ";", "//smf call to go here, eventually", "}", "else", "if", "(", "batchStatus", "==", "BatchStatus", ".", "STOPPING", ")", "{", "publishEvent", "(", "jobInstance", ",", "BatchEventsPublisher", ".", "TOPIC_INSTANCE_STOPPING", ")", ";", "publishEvent", "(", "execution", ",", "BatchEventsPublisher", ".", "TOPIC_EXECUTION_STOPPING", ")", ";", "}", "else", "if", "(", "batchStatus", "==", "BatchStatus", ".", "STARTED", ")", "{", "publishEvent", "(", "jobInstance", ",", "BatchEventsPublisher", ".", "TOPIC_INSTANCE_DISPATCHED", ")", ";", "publishEvent", "(", "execution", ",", "BatchEventsPublisher", ".", "TOPIC_EXECUTION_STARTED", ")", ";", "}", "}" ]
Helper method to publish execution data to appropriate topic per batchStatus @param execution @param jobInstance @param batchStatus
[ "Helper", "method", "to", "publish", "execution", "data", "to", "appropriate", "topic", "per", "batchStatus" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeJobExecution.java#L215-L235
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadManager.java
ThreadManager.getInstance
public static ThreadManager getInstance() { if (thisClass == null) { thisClass = new ThreadManager(); String useInheritableThreadLocalString = SSLConfigManager.getInstance().getGlobalProperty(Constants.SSLPROP_USE_INHERITABLE_THREAD_LOCAL); if (useInheritableThreadLocalString != null && (useInheritableThreadLocalString.equalsIgnoreCase("true") || useInheritableThreadLocalString.equalsIgnoreCase("yes"))) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "useInheritableThreadLocal is enabled."); useInheritableThreadLocal = true; } } return thisClass; }
java
public static ThreadManager getInstance() { if (thisClass == null) { thisClass = new ThreadManager(); String useInheritableThreadLocalString = SSLConfigManager.getInstance().getGlobalProperty(Constants.SSLPROP_USE_INHERITABLE_THREAD_LOCAL); if (useInheritableThreadLocalString != null && (useInheritableThreadLocalString.equalsIgnoreCase("true") || useInheritableThreadLocalString.equalsIgnoreCase("yes"))) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "useInheritableThreadLocal is enabled."); useInheritableThreadLocal = true; } } return thisClass; }
[ "public", "static", "ThreadManager", "getInstance", "(", ")", "{", "if", "(", "thisClass", "==", "null", ")", "{", "thisClass", "=", "new", "ThreadManager", "(", ")", ";", "String", "useInheritableThreadLocalString", "=", "SSLConfigManager", ".", "getInstance", "(", ")", ".", "getGlobalProperty", "(", "Constants", ".", "SSLPROP_USE_INHERITABLE_THREAD_LOCAL", ")", ";", "if", "(", "useInheritableThreadLocalString", "!=", "null", "&&", "(", "useInheritableThreadLocalString", ".", "equalsIgnoreCase", "(", "\"true\"", ")", "||", "useInheritableThreadLocalString", ".", "equalsIgnoreCase", "(", "\"yes\"", ")", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"useInheritableThreadLocal is enabled.\"", ")", ";", "useInheritableThreadLocal", "=", "true", ";", "}", "}", "return", "thisClass", ";", "}" ]
Access the singleton instance of this class. @return ThreadManager
[ "Access", "the", "singleton", "instance", "of", "this", "class", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadManager.java#L55-L68
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadManager.java
ThreadManager.getThreadContext
public ThreadContext getThreadContext() { if (useInheritableThreadLocal && !SSLConfigManager.getInstance().isServerProcess()) { ThreadContext context = inheritableThreadLocStorage.get(); if (context == null) { context = new ThreadContext(); inheritableThreadLocStorage.set(context); } return context; } ThreadContext context = threadLocStorage.get(); if (context == null) { context = new ThreadContext(); threadLocStorage.set(context); } return context; }
java
public ThreadContext getThreadContext() { if (useInheritableThreadLocal && !SSLConfigManager.getInstance().isServerProcess()) { ThreadContext context = inheritableThreadLocStorage.get(); if (context == null) { context = new ThreadContext(); inheritableThreadLocStorage.set(context); } return context; } ThreadContext context = threadLocStorage.get(); if (context == null) { context = new ThreadContext(); threadLocStorage.set(context); } return context; }
[ "public", "ThreadContext", "getThreadContext", "(", ")", "{", "if", "(", "useInheritableThreadLocal", "&&", "!", "SSLConfigManager", ".", "getInstance", "(", ")", ".", "isServerProcess", "(", ")", ")", "{", "ThreadContext", "context", "=", "inheritableThreadLocStorage", ".", "get", "(", ")", ";", "if", "(", "context", "==", "null", ")", "{", "context", "=", "new", "ThreadContext", "(", ")", ";", "inheritableThreadLocStorage", ".", "set", "(", "context", ")", ";", "}", "return", "context", ";", "}", "ThreadContext", "context", "=", "threadLocStorage", ".", "get", "(", ")", ";", "if", "(", "context", "==", "null", ")", "{", "context", "=", "new", "ThreadContext", "(", ")", ";", "threadLocStorage", ".", "set", "(", "context", ")", ";", "}", "return", "context", ";", "}" ]
Access the current thread context. @return ThreadContext
[ "Access", "the", "current", "thread", "context", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadManager.java#L75-L93
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.stop
public void stop() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "stop"); ivIsInitialized = false; if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "stop"); }
java
public void stop() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "stop"); ivIsInitialized = false; if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "stop"); }
[ "public", "void", "stop", "(", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"stop\"", ")", ";", "ivIsInitialized", "=", "false", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"stop\"", ")", ";", "}" ]
Set the initialized flag to false so that others may not NOT register in their start method.
[ "Set", "the", "initialized", "flag", "to", "false", "so", "that", "others", "may", "not", "NOT", "register", "in", "their", "start", "method", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L263-L271
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.registerInjectionProcessor
@Override public <A extends Annotation, AS extends Annotation> void registerInjectionProcessor (Class<? extends InjectionProcessor<A, AS>> processor, Class<A> annotation) throws InjectionException { if (OverrideInjectionProcessor.class.isAssignableFrom(processor)) // RTC114863 { throw new IllegalArgumentException("OverrideInjectionProcessor must be registered with an InjectionProcessorProvider"); } registerInjectionProcessorProvider(new InjectionProcessorProviderImpl<A, AS>(annotation, processor)); }
java
@Override public <A extends Annotation, AS extends Annotation> void registerInjectionProcessor (Class<? extends InjectionProcessor<A, AS>> processor, Class<A> annotation) throws InjectionException { if (OverrideInjectionProcessor.class.isAssignableFrom(processor)) // RTC114863 { throw new IllegalArgumentException("OverrideInjectionProcessor must be registered with an InjectionProcessorProvider"); } registerInjectionProcessorProvider(new InjectionProcessorProviderImpl<A, AS>(annotation, processor)); }
[ "@", "Override", "public", "<", "A", "extends", "Annotation", ",", "AS", "extends", "Annotation", ">", "void", "registerInjectionProcessor", "(", "Class", "<", "?", "extends", "InjectionProcessor", "<", "A", ",", "AS", ">", ">", "processor", ",", "Class", "<", "A", ">", "annotation", ")", "throws", "InjectionException", "{", "if", "(", "OverrideInjectionProcessor", ".", "class", ".", "isAssignableFrom", "(", "processor", ")", ")", "// RTC114863", "{", "throw", "new", "IllegalArgumentException", "(", "\"OverrideInjectionProcessor must be registered with an InjectionProcessorProvider\"", ")", ";", "}", "registerInjectionProcessorProvider", "(", "new", "InjectionProcessorProviderImpl", "<", "A", ",", "AS", ">", "(", "annotation", ",", "processor", ")", ")", ";", "}" ]
Registers the specified processor with the injection engine. If a processor was already registered with the specified annotation, that class will be returned otherwise a null will be returned. @param processor The processor class to be registered @param annotation The annotation class the processor is associated. @throws InjectionException if the provider is already registered
[ "Registers", "the", "specified", "processor", "with", "the", "injection", "engine", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L283-L295
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.processInjectionMetaData
@Override public void processInjectionMetaData (HashMap<Class<?>, InjectionTarget[]> injectionTargetMap, ComponentNameSpaceConfiguration compNSConfig) throws InjectionException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "processInjectionMetaData (targets)"); InjectionProcessorContextImpl context = createInjectionProcessorContext(); // F743-31682 - Always bind in the client container code flow. context.ivBindNonCompInjectionBindings = compNSConfig.isClientContainer() && compNSConfig.getClassLoader() != null; compNSConfig.setInjectionProcessorContext(context); processInjectionMetaData(compNSConfig, null); List<Class<?>> injectionClasses = compNSConfig.getInjectionClasses(); if (injectionClasses != null && !injectionClasses.isEmpty()) // d721619 { Map<Class<?>, List<InjectionTarget>> declaredTargets = getDeclaredInjectionTargets(context.ivProcessedInjectionBindings); boolean checkAppConfig = compNSConfig.isCheckApplicationConfiguration(); for (Class<?> injectionClass : injectionClasses) { InjectionTarget[] injectionTargets = getInjectionTargets(declaredTargets, injectionClass, checkAppConfig); injectionTargetMap.put(injectionClass, injectionTargets); } } context.metadataProcessingComplete(); // F87539 notifyInjectionMetaDataListeners(null, compNSConfig); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "processInjectionMetaData: " + injectionTargetMap); }
java
@Override public void processInjectionMetaData (HashMap<Class<?>, InjectionTarget[]> injectionTargetMap, ComponentNameSpaceConfiguration compNSConfig) throws InjectionException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "processInjectionMetaData (targets)"); InjectionProcessorContextImpl context = createInjectionProcessorContext(); // F743-31682 - Always bind in the client container code flow. context.ivBindNonCompInjectionBindings = compNSConfig.isClientContainer() && compNSConfig.getClassLoader() != null; compNSConfig.setInjectionProcessorContext(context); processInjectionMetaData(compNSConfig, null); List<Class<?>> injectionClasses = compNSConfig.getInjectionClasses(); if (injectionClasses != null && !injectionClasses.isEmpty()) // d721619 { Map<Class<?>, List<InjectionTarget>> declaredTargets = getDeclaredInjectionTargets(context.ivProcessedInjectionBindings); boolean checkAppConfig = compNSConfig.isCheckApplicationConfiguration(); for (Class<?> injectionClass : injectionClasses) { InjectionTarget[] injectionTargets = getInjectionTargets(declaredTargets, injectionClass, checkAppConfig); injectionTargetMap.put(injectionClass, injectionTargets); } } context.metadataProcessingComplete(); // F87539 notifyInjectionMetaDataListeners(null, compNSConfig); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "processInjectionMetaData: " + injectionTargetMap); }
[ "@", "Override", "public", "void", "processInjectionMetaData", "(", "HashMap", "<", "Class", "<", "?", ">", ",", "InjectionTarget", "[", "]", ">", "injectionTargetMap", ",", "ComponentNameSpaceConfiguration", "compNSConfig", ")", "throws", "InjectionException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"processInjectionMetaData (targets)\"", ")", ";", "InjectionProcessorContextImpl", "context", "=", "createInjectionProcessorContext", "(", ")", ";", "// F743-31682 - Always bind in the client container code flow.", "context", ".", "ivBindNonCompInjectionBindings", "=", "compNSConfig", ".", "isClientContainer", "(", ")", "&&", "compNSConfig", ".", "getClassLoader", "(", ")", "!=", "null", ";", "compNSConfig", ".", "setInjectionProcessorContext", "(", "context", ")", ";", "processInjectionMetaData", "(", "compNSConfig", ",", "null", ")", ";", "List", "<", "Class", "<", "?", ">", ">", "injectionClasses", "=", "compNSConfig", ".", "getInjectionClasses", "(", ")", ";", "if", "(", "injectionClasses", "!=", "null", "&&", "!", "injectionClasses", ".", "isEmpty", "(", ")", ")", "// d721619", "{", "Map", "<", "Class", "<", "?", ">", ",", "List", "<", "InjectionTarget", ">", ">", "declaredTargets", "=", "getDeclaredInjectionTargets", "(", "context", ".", "ivProcessedInjectionBindings", ")", ";", "boolean", "checkAppConfig", "=", "compNSConfig", ".", "isCheckApplicationConfiguration", "(", ")", ";", "for", "(", "Class", "<", "?", ">", "injectionClass", ":", "injectionClasses", ")", "{", "InjectionTarget", "[", "]", "injectionTargets", "=", "getInjectionTargets", "(", "declaredTargets", ",", "injectionClass", ",", "checkAppConfig", ")", ";", "injectionTargetMap", ".", "put", "(", "injectionClass", ",", "injectionTargets", ")", ";", "}", "}", "context", ".", "metadataProcessingComplete", "(", ")", ";", "// F87539", "notifyInjectionMetaDataListeners", "(", "null", ",", "compNSConfig", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"processInjectionMetaData: \"", "+", "injectionTargetMap", ")", ";", "}" ]
Populates the empty cookie map with cookies to be injections. @param injectionTargetMap An empty map to be populated with the injection targets from the merged xml and annotations. @param compNSConfig The component configuration information provided by the container. @throws InjectionException if an error occurs processing the injection metadata
[ "Populates", "the", "empty", "cookie", "map", "with", "cookies", "to", "be", "injections", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L404-L441
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.processInjectionMetaData
protected void processInjectionMetaData(ComponentNameSpaceConfiguration compNSConfig, List<Class<?>> annotatedClasses) throws InjectionException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "processInjectionMetaData: " + compNSConfig.toDumpString()); // Provide the default Naming ObjectFactory implementations if the // component has not provided an override. d442047 if (compNSConfig.getIndirectJndiLookupReferenceFactory() == null) compNSConfig.setIndirectJndiLookupReferenceFactory(getDefaultIndirectJndiLookupReferenceFactory()); if (compNSConfig.getResIndirectJndiLookupReferenceFactory() == null) compNSConfig.setResIndirectJndiLookupReferenceFactory(getDefaultResIndirectJndiLookupReferenceFactory()); if (compNSConfig.getResRefReferenceFactory() == null) compNSConfig.setResRefReferenceFactory(getDefaultResRefReferenceFactory()); if (compNSConfig.getResAutoLinkReferenceFactory() == null) compNSConfig.setResAutoLinkReferenceFactory(getDefaultResAutoLinkReferenceFactory()); // F48603.9 if (compNSConfig.getEJBLinkReferenceFactory() == null) compNSConfig.setEJBLinkReferenceFactory(getDefaultEJBLinkReferenceFactory()); if (compNSConfig.getMBLinkReferenceFactory() == null) // d703474 - FIXME: we should use a consistent MBLinkReferenceFactory // and a per-process MBFactory, but for now, force the injection // MBLinkReferenceFactory for client. compNSConfig.setMBLinkReferenceFactory(compNSConfig.isClientContainer() ? DEFAULT_MBLinkRefFactory : ivMBLinkRefFactory); InjectionProcessorContextImpl context = InjectionProcessorContextImpl.get(compNSConfig); context.ivJavaNameSpaceContext = compNSConfig.getJavaColonContext(); // d682474 List<InjectionProcessorProvider<?, ?>> providers = new ArrayList<InjectionProcessorProvider<?, ?>>(ivProcessorProviders.values()); InjectionProcessorManager processorManager = new InjectionProcessorManager(this, compNSConfig, context, providers); // Extract all the persistence related specification from the deployment // description xml. processorManager.processXML(); // Populate the injectionTargetMap with the the annotation information // using the registered processors and instance classes if (annotatedClasses == null) // F743-33811.1 { if (!compNSConfig.isMetaDataComplete()) { annotatedClasses = compNSConfig.getInjectionClasses(); } if (annotatedClasses == null) { annotatedClasses = Collections.emptyList(); } } if (!annotatedClasses.isEmpty()) { ClassLoader loader = compNSConfig.getClassLoader(); if (loader != null) { checkAnnotationClasses(loader); // d676633 } for (Class<?> annotatedClass : annotatedClasses) { processorManager.processAnnotations(annotatedClass); } } processorManager.processBindings(); //d500868 // For federated client modules, collect all the client injection targets // and make them available to client processes. if (compNSConfig.getOwningFlow() == ComponentNameSpaceConfiguration.ReferenceFlowKind.CLIENT && compNSConfig.getClassLoader() == null) { processClientInjections(compNSConfig, context); // F743-33811.1 } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "processInjectionMetaData"); }
java
protected void processInjectionMetaData(ComponentNameSpaceConfiguration compNSConfig, List<Class<?>> annotatedClasses) throws InjectionException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "processInjectionMetaData: " + compNSConfig.toDumpString()); // Provide the default Naming ObjectFactory implementations if the // component has not provided an override. d442047 if (compNSConfig.getIndirectJndiLookupReferenceFactory() == null) compNSConfig.setIndirectJndiLookupReferenceFactory(getDefaultIndirectJndiLookupReferenceFactory()); if (compNSConfig.getResIndirectJndiLookupReferenceFactory() == null) compNSConfig.setResIndirectJndiLookupReferenceFactory(getDefaultResIndirectJndiLookupReferenceFactory()); if (compNSConfig.getResRefReferenceFactory() == null) compNSConfig.setResRefReferenceFactory(getDefaultResRefReferenceFactory()); if (compNSConfig.getResAutoLinkReferenceFactory() == null) compNSConfig.setResAutoLinkReferenceFactory(getDefaultResAutoLinkReferenceFactory()); // F48603.9 if (compNSConfig.getEJBLinkReferenceFactory() == null) compNSConfig.setEJBLinkReferenceFactory(getDefaultEJBLinkReferenceFactory()); if (compNSConfig.getMBLinkReferenceFactory() == null) // d703474 - FIXME: we should use a consistent MBLinkReferenceFactory // and a per-process MBFactory, but for now, force the injection // MBLinkReferenceFactory for client. compNSConfig.setMBLinkReferenceFactory(compNSConfig.isClientContainer() ? DEFAULT_MBLinkRefFactory : ivMBLinkRefFactory); InjectionProcessorContextImpl context = InjectionProcessorContextImpl.get(compNSConfig); context.ivJavaNameSpaceContext = compNSConfig.getJavaColonContext(); // d682474 List<InjectionProcessorProvider<?, ?>> providers = new ArrayList<InjectionProcessorProvider<?, ?>>(ivProcessorProviders.values()); InjectionProcessorManager processorManager = new InjectionProcessorManager(this, compNSConfig, context, providers); // Extract all the persistence related specification from the deployment // description xml. processorManager.processXML(); // Populate the injectionTargetMap with the the annotation information // using the registered processors and instance classes if (annotatedClasses == null) // F743-33811.1 { if (!compNSConfig.isMetaDataComplete()) { annotatedClasses = compNSConfig.getInjectionClasses(); } if (annotatedClasses == null) { annotatedClasses = Collections.emptyList(); } } if (!annotatedClasses.isEmpty()) { ClassLoader loader = compNSConfig.getClassLoader(); if (loader != null) { checkAnnotationClasses(loader); // d676633 } for (Class<?> annotatedClass : annotatedClasses) { processorManager.processAnnotations(annotatedClass); } } processorManager.processBindings(); //d500868 // For federated client modules, collect all the client injection targets // and make them available to client processes. if (compNSConfig.getOwningFlow() == ComponentNameSpaceConfiguration.ReferenceFlowKind.CLIENT && compNSConfig.getClassLoader() == null) { processClientInjections(compNSConfig, context); // F743-33811.1 } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "processInjectionMetaData"); }
[ "protected", "void", "processInjectionMetaData", "(", "ComponentNameSpaceConfiguration", "compNSConfig", ",", "List", "<", "Class", "<", "?", ">", ">", "annotatedClasses", ")", "throws", "InjectionException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"processInjectionMetaData: \"", "+", "compNSConfig", ".", "toDumpString", "(", ")", ")", ";", "// Provide the default Naming ObjectFactory implementations if the", "// component has not provided an override. d442047", "if", "(", "compNSConfig", ".", "getIndirectJndiLookupReferenceFactory", "(", ")", "==", "null", ")", "compNSConfig", ".", "setIndirectJndiLookupReferenceFactory", "(", "getDefaultIndirectJndiLookupReferenceFactory", "(", ")", ")", ";", "if", "(", "compNSConfig", ".", "getResIndirectJndiLookupReferenceFactory", "(", ")", "==", "null", ")", "compNSConfig", ".", "setResIndirectJndiLookupReferenceFactory", "(", "getDefaultResIndirectJndiLookupReferenceFactory", "(", ")", ")", ";", "if", "(", "compNSConfig", ".", "getResRefReferenceFactory", "(", ")", "==", "null", ")", "compNSConfig", ".", "setResRefReferenceFactory", "(", "getDefaultResRefReferenceFactory", "(", ")", ")", ";", "if", "(", "compNSConfig", ".", "getResAutoLinkReferenceFactory", "(", ")", "==", "null", ")", "compNSConfig", ".", "setResAutoLinkReferenceFactory", "(", "getDefaultResAutoLinkReferenceFactory", "(", ")", ")", ";", "// F48603.9", "if", "(", "compNSConfig", ".", "getEJBLinkReferenceFactory", "(", ")", "==", "null", ")", "compNSConfig", ".", "setEJBLinkReferenceFactory", "(", "getDefaultEJBLinkReferenceFactory", "(", ")", ")", ";", "if", "(", "compNSConfig", ".", "getMBLinkReferenceFactory", "(", ")", "==", "null", ")", "// d703474 - FIXME: we should use a consistent MBLinkReferenceFactory", "// and a per-process MBFactory, but for now, force the injection", "// MBLinkReferenceFactory for client.", "compNSConfig", ".", "setMBLinkReferenceFactory", "(", "compNSConfig", ".", "isClientContainer", "(", ")", "?", "DEFAULT_MBLinkRefFactory", ":", "ivMBLinkRefFactory", ")", ";", "InjectionProcessorContextImpl", "context", "=", "InjectionProcessorContextImpl", ".", "get", "(", "compNSConfig", ")", ";", "context", ".", "ivJavaNameSpaceContext", "=", "compNSConfig", ".", "getJavaColonContext", "(", ")", ";", "// d682474", "List", "<", "InjectionProcessorProvider", "<", "?", ",", "?", ">", ">", "providers", "=", "new", "ArrayList", "<", "InjectionProcessorProvider", "<", "?", ",", "?", ">", ">", "(", "ivProcessorProviders", ".", "values", "(", ")", ")", ";", "InjectionProcessorManager", "processorManager", "=", "new", "InjectionProcessorManager", "(", "this", ",", "compNSConfig", ",", "context", ",", "providers", ")", ";", "// Extract all the persistence related specification from the deployment", "// description xml.", "processorManager", ".", "processXML", "(", ")", ";", "// Populate the injectionTargetMap with the the annotation information", "// using the registered processors and instance classes", "if", "(", "annotatedClasses", "==", "null", ")", "// F743-33811.1", "{", "if", "(", "!", "compNSConfig", ".", "isMetaDataComplete", "(", ")", ")", "{", "annotatedClasses", "=", "compNSConfig", ".", "getInjectionClasses", "(", ")", ";", "}", "if", "(", "annotatedClasses", "==", "null", ")", "{", "annotatedClasses", "=", "Collections", ".", "emptyList", "(", ")", ";", "}", "}", "if", "(", "!", "annotatedClasses", ".", "isEmpty", "(", ")", ")", "{", "ClassLoader", "loader", "=", "compNSConfig", ".", "getClassLoader", "(", ")", ";", "if", "(", "loader", "!=", "null", ")", "{", "checkAnnotationClasses", "(", "loader", ")", ";", "// d676633", "}", "for", "(", "Class", "<", "?", ">", "annotatedClass", ":", "annotatedClasses", ")", "{", "processorManager", ".", "processAnnotations", "(", "annotatedClass", ")", ";", "}", "}", "processorManager", ".", "processBindings", "(", ")", ";", "//d500868", "// For federated client modules, collect all the client injection targets", "// and make them available to client processes.", "if", "(", "compNSConfig", ".", "getOwningFlow", "(", ")", "==", "ComponentNameSpaceConfiguration", ".", "ReferenceFlowKind", ".", "CLIENT", "&&", "compNSConfig", ".", "getClassLoader", "(", ")", "==", "null", ")", "{", "processClientInjections", "(", "compNSConfig", ",", "context", ")", ";", "// F743-33811.1", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"processInjectionMetaData\"", ")", ";", "}" ]
Processes injection metadata using the specified configuration with InjectionProcessorContext already set. @param compNSConfig the component configuration with InjectionProcessorContext already set @param annotatedClasses the list of classes that should be processed for annotations, or <tt>null</tt> if the list should be determined from {@link ComponentNameSpaceConfiguration#getInjectionClasses}
[ "Processes", "injection", "metadata", "using", "the", "specified", "configuration", "with", "InjectionProcessorContext", "already", "set", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L452-L529
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.checkAnnotationClasses
private void checkAnnotationClasses(ClassLoader loader) // d676633 { boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isDebugEnabled()) Tr.entry(tc, "checkAnnotationClasses: " + loader); // All EJBs in an application share the same class loader. Only check // a given class loader once. if (ivCheckedAnnotationClassLoaders.add(loader)) { for (Class<?> processorClass : ivProcessorProviders.keySet()) { String className = processorClass.getName(); Class<?> loaderClass; try { loaderClass = loader.loadClass(className); } catch (ClassNotFoundException ex) { // At least it hasn't been overridden, so ignore per WAB. F53641 if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "ignoring " + className + " : " + ex); continue; } if (loaderClass != processorClass) { Set<String> warnedAnnotations = null; ClassLoader loaderClassLoader = loaderClass.getClassLoader(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "loaded " + loaderClass + " from application class loader " + loaderClassLoader); synchronized (this) { if (ivWarnedClassLoaderAnnotations == null) { ivWarnedClassLoaderAnnotations = new WeakHashMap<ClassLoader, Set<String>>(); } warnedAnnotations = ivWarnedClassLoaderAnnotations.get(loaderClassLoader); if (warnedAnnotations == null) { warnedAnnotations = Collections.synchronizedSet(new HashSet<String>()); ivWarnedClassLoaderAnnotations.put(loaderClassLoader, warnedAnnotations); } } // Only warn once about a particular class loader loading a // particular annotation class. We do not want a PARENT_LAST // application to generate warnings for every child WAR class // loader. Similarly for application server class loaders. if (warnedAnnotations == null || warnedAnnotations.add(className)) { CodeSource codeSource = loaderClass.getProtectionDomain().getCodeSource(); String codeSourceLocation = codeSource == null ? null : String.valueOf(codeSource.getLocation()); Tr.warning(tc, "INCOMPATIBLE_ANNOTATION_CLASS_CWNEN0070W", className, codeSourceLocation); } } } } if (isTraceOn && tc.isDebugEnabled()) Tr.exit(tc, "checkAnnotationClasses"); }
java
private void checkAnnotationClasses(ClassLoader loader) // d676633 { boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isDebugEnabled()) Tr.entry(tc, "checkAnnotationClasses: " + loader); // All EJBs in an application share the same class loader. Only check // a given class loader once. if (ivCheckedAnnotationClassLoaders.add(loader)) { for (Class<?> processorClass : ivProcessorProviders.keySet()) { String className = processorClass.getName(); Class<?> loaderClass; try { loaderClass = loader.loadClass(className); } catch (ClassNotFoundException ex) { // At least it hasn't been overridden, so ignore per WAB. F53641 if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "ignoring " + className + " : " + ex); continue; } if (loaderClass != processorClass) { Set<String> warnedAnnotations = null; ClassLoader loaderClassLoader = loaderClass.getClassLoader(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "loaded " + loaderClass + " from application class loader " + loaderClassLoader); synchronized (this) { if (ivWarnedClassLoaderAnnotations == null) { ivWarnedClassLoaderAnnotations = new WeakHashMap<ClassLoader, Set<String>>(); } warnedAnnotations = ivWarnedClassLoaderAnnotations.get(loaderClassLoader); if (warnedAnnotations == null) { warnedAnnotations = Collections.synchronizedSet(new HashSet<String>()); ivWarnedClassLoaderAnnotations.put(loaderClassLoader, warnedAnnotations); } } // Only warn once about a particular class loader loading a // particular annotation class. We do not want a PARENT_LAST // application to generate warnings for every child WAR class // loader. Similarly for application server class loaders. if (warnedAnnotations == null || warnedAnnotations.add(className)) { CodeSource codeSource = loaderClass.getProtectionDomain().getCodeSource(); String codeSourceLocation = codeSource == null ? null : String.valueOf(codeSource.getLocation()); Tr.warning(tc, "INCOMPATIBLE_ANNOTATION_CLASS_CWNEN0070W", className, codeSourceLocation); } } } } if (isTraceOn && tc.isDebugEnabled()) Tr.exit(tc, "checkAnnotationClasses"); }
[ "private", "void", "checkAnnotationClasses", "(", "ClassLoader", "loader", ")", "// d676633", "{", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"checkAnnotationClasses: \"", "+", "loader", ")", ";", "// All EJBs in an application share the same class loader. Only check", "// a given class loader once.", "if", "(", "ivCheckedAnnotationClassLoaders", ".", "add", "(", "loader", ")", ")", "{", "for", "(", "Class", "<", "?", ">", "processorClass", ":", "ivProcessorProviders", ".", "keySet", "(", ")", ")", "{", "String", "className", "=", "processorClass", ".", "getName", "(", ")", ";", "Class", "<", "?", ">", "loaderClass", ";", "try", "{", "loaderClass", "=", "loader", ".", "loadClass", "(", "className", ")", ";", "}", "catch", "(", "ClassNotFoundException", "ex", ")", "{", "// At least it hasn't been overridden, so ignore per WAB. F53641", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"ignoring \"", "+", "className", "+", "\" : \"", "+", "ex", ")", ";", "continue", ";", "}", "if", "(", "loaderClass", "!=", "processorClass", ")", "{", "Set", "<", "String", ">", "warnedAnnotations", "=", "null", ";", "ClassLoader", "loaderClassLoader", "=", "loaderClass", ".", "getClassLoader", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"loaded \"", "+", "loaderClass", "+", "\" from application class loader \"", "+", "loaderClassLoader", ")", ";", "synchronized", "(", "this", ")", "{", "if", "(", "ivWarnedClassLoaderAnnotations", "==", "null", ")", "{", "ivWarnedClassLoaderAnnotations", "=", "new", "WeakHashMap", "<", "ClassLoader", ",", "Set", "<", "String", ">", ">", "(", ")", ";", "}", "warnedAnnotations", "=", "ivWarnedClassLoaderAnnotations", ".", "get", "(", "loaderClassLoader", ")", ";", "if", "(", "warnedAnnotations", "==", "null", ")", "{", "warnedAnnotations", "=", "Collections", ".", "synchronizedSet", "(", "new", "HashSet", "<", "String", ">", "(", ")", ")", ";", "ivWarnedClassLoaderAnnotations", ".", "put", "(", "loaderClassLoader", ",", "warnedAnnotations", ")", ";", "}", "}", "// Only warn once about a particular class loader loading a", "// particular annotation class. We do not want a PARENT_LAST", "// application to generate warnings for every child WAR class", "// loader. Similarly for application server class loaders.", "if", "(", "warnedAnnotations", "==", "null", "||", "warnedAnnotations", ".", "add", "(", "className", ")", ")", "{", "CodeSource", "codeSource", "=", "loaderClass", ".", "getProtectionDomain", "(", ")", ".", "getCodeSource", "(", ")", ";", "String", "codeSourceLocation", "=", "codeSource", "==", "null", "?", "null", ":", "String", ".", "valueOf", "(", "codeSource", ".", "getLocation", "(", ")", ")", ";", "Tr", ".", "warning", "(", "tc", ",", "\"INCOMPATIBLE_ANNOTATION_CLASS_CWNEN0070W\"", ",", "className", ",", "codeSourceLocation", ")", ";", "}", "}", "}", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"checkAnnotationClasses\"", ")", ";", "}" ]
Check the specified class loader to check if it has overridden any annotation classes processed by the injection engine.
[ "Check", "the", "specified", "class", "loader", "to", "check", "if", "it", "has", "overridden", "any", "annotation", "classes", "processed", "by", "the", "injection", "engine", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L535-L602
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.inject
@Override public void inject(Object objectToInject, InjectionTarget injectionTarget) throws InjectionException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "inject", objectToInject, injectionTarget); injectionTarget.inject(objectToInject, null); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "inject"); }
java
@Override public void inject(Object objectToInject, InjectionTarget injectionTarget) throws InjectionException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "inject", objectToInject, injectionTarget); injectionTarget.inject(objectToInject, null); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "inject"); }
[ "@", "Override", "public", "void", "inject", "(", "Object", "objectToInject", ",", "InjectionTarget", "injectionTarget", ")", "throws", "InjectionException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"inject\"", ",", "objectToInject", ",", "injectionTarget", ")", ";", "injectionTarget", ".", "inject", "(", "objectToInject", ",", "null", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"inject\"", ")", ";", "}" ]
This method handles the actual injection of injectedObject to the target beanObject using either the METHOD or FIELD specified in the injectionTarget.
[ "This", "method", "handles", "the", "actual", "injection", "of", "injectedObject", "to", "the", "target", "beanObject", "using", "either", "the", "METHOD", "or", "FIELD", "specified", "in", "the", "injectionTarget", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L822-L835
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.registerInjectionMetaDataListener
@Override public void registerInjectionMetaDataListener(InjectionMetaDataListener metaDataListener) { if (metaDataListener == null) { throw new IllegalArgumentException("A null InjectionMetaDataListener cannot be registered " + "with the injection engine."); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "registerInjectionMetaDataListener", metaDataListener.getClass().getName()); metaDataListeners.add(metaDataListener); }
java
@Override public void registerInjectionMetaDataListener(InjectionMetaDataListener metaDataListener) { if (metaDataListener == null) { throw new IllegalArgumentException("A null InjectionMetaDataListener cannot be registered " + "with the injection engine."); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "registerInjectionMetaDataListener", metaDataListener.getClass().getName()); metaDataListeners.add(metaDataListener); }
[ "@", "Override", "public", "void", "registerInjectionMetaDataListener", "(", "InjectionMetaDataListener", "metaDataListener", ")", "{", "if", "(", "metaDataListener", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"A null InjectionMetaDataListener cannot be registered \"", "+", "\"with the injection engine.\"", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"registerInjectionMetaDataListener\"", ",", "metaDataListener", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "metaDataListeners", ".", "add", "(", "metaDataListener", ")", ";", "}" ]
This method will register an instance of an InjectionMetaDataListener with the current engine instance.
[ "This", "method", "will", "register", "an", "instance", "of", "an", "InjectionMetaDataListener", "with", "the", "current", "engine", "instance", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L887-L897
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.unregisterInjectionMetaDataListener
@Override public void unregisterInjectionMetaDataListener(InjectionMetaDataListener metaDataListener) { if (metaDataListener == null) { throw new IllegalArgumentException("A null InjectionMetaDataListener cannot be unregistered " + "from the injection engine."); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "unregisterInjectionMetaDataListener", metaDataListener.getClass().getName()); metaDataListeners.remove(metaDataListener); }
java
@Override public void unregisterInjectionMetaDataListener(InjectionMetaDataListener metaDataListener) { if (metaDataListener == null) { throw new IllegalArgumentException("A null InjectionMetaDataListener cannot be unregistered " + "from the injection engine."); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "unregisterInjectionMetaDataListener", metaDataListener.getClass().getName()); metaDataListeners.remove(metaDataListener); }
[ "@", "Override", "public", "void", "unregisterInjectionMetaDataListener", "(", "InjectionMetaDataListener", "metaDataListener", ")", "{", "if", "(", "metaDataListener", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"A null InjectionMetaDataListener cannot be unregistered \"", "+", "\"from the injection engine.\"", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"unregisterInjectionMetaDataListener\"", ",", "metaDataListener", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "metaDataListeners", ".", "remove", "(", "metaDataListener", ")", ";", "}" ]
This method will unregister an instance of an InjectionMetaDataListener with the current engine instance.
[ "This", "method", "will", "unregister", "an", "instance", "of", "an", "InjectionMetaDataListener", "with", "the", "current", "engine", "instance", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L903-L913
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.registerOverrideReferenceFactory
@Override public <A extends Annotation> void registerOverrideReferenceFactory(Class<A> annotation, OverrideReferenceFactory<A> factory) throws InjectionException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "registerOverrideReferenceFactory", annotation, factory); if (annotation == null || factory == null) { throw new IllegalArgumentException("Null arguments are not allowed: " + annotation + ", " + factory); } // Now add the new factory to the map, per annotation. synchronized (this) { HashMap<Class<? extends Annotation>, OverrideReferenceFactory<?>[]> map = ivOverrideReferenceFactoryMap; if (ivOverrideReferenceFactoryMapCopyOnWrite) // PM79779 F743-32696 { HashMap<Class<? extends Annotation>, OverrideReferenceFactory<?>[]> newMap = new HashMap<Class<? extends Annotation>, OverrideReferenceFactory<?>[]>(); for (Map.Entry<Class<? extends Annotation>, OverrideReferenceFactory<?>[]> entry : map.entrySet()) { OverrideReferenceFactory<?>[] value = entry.getValue(); OverrideReferenceFactory<?>[] newValue = new OverrideReferenceFactory[value.length]; System.arraycopy(value, 0, newValue, 0, value.length); newMap.put(entry.getKey(), newValue); } map = newMap; } OverrideReferenceFactory<?>[] factories = map.get(annotation); if (factories == null) { if (!ivProcessorProviders.containsKey(annotation)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "registerOverrideReferenceFactory: An injection " + "processor does not exist for the specified annotation: " + annotation.getName()); throw new InjectionException("An injection processor does not exist for the specified annotation: " + annotation.getName()); } factories = new OverrideReferenceFactory[1]; factories[0] = factory; map.put(annotation, factories); } else { OverrideReferenceFactory<?>[] newFactories = new OverrideReferenceFactory[factories.length + 1]; System.arraycopy(factories, 0, newFactories, 0, factories.length); newFactories[factories.length] = factory; map.put(annotation, newFactories); } if (ivOverrideReferenceFactoryMapCopyOnWrite) // PM79779 F743-32696 { // Replace exiting map after all updates have been made. ivOverrideReferenceFactoryMap = map; ivOverrideReferenceFactoryMapCopyOnWrite = false; } } }
java
@Override public <A extends Annotation> void registerOverrideReferenceFactory(Class<A> annotation, OverrideReferenceFactory<A> factory) throws InjectionException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "registerOverrideReferenceFactory", annotation, factory); if (annotation == null || factory == null) { throw new IllegalArgumentException("Null arguments are not allowed: " + annotation + ", " + factory); } // Now add the new factory to the map, per annotation. synchronized (this) { HashMap<Class<? extends Annotation>, OverrideReferenceFactory<?>[]> map = ivOverrideReferenceFactoryMap; if (ivOverrideReferenceFactoryMapCopyOnWrite) // PM79779 F743-32696 { HashMap<Class<? extends Annotation>, OverrideReferenceFactory<?>[]> newMap = new HashMap<Class<? extends Annotation>, OverrideReferenceFactory<?>[]>(); for (Map.Entry<Class<? extends Annotation>, OverrideReferenceFactory<?>[]> entry : map.entrySet()) { OverrideReferenceFactory<?>[] value = entry.getValue(); OverrideReferenceFactory<?>[] newValue = new OverrideReferenceFactory[value.length]; System.arraycopy(value, 0, newValue, 0, value.length); newMap.put(entry.getKey(), newValue); } map = newMap; } OverrideReferenceFactory<?>[] factories = map.get(annotation); if (factories == null) { if (!ivProcessorProviders.containsKey(annotation)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "registerOverrideReferenceFactory: An injection " + "processor does not exist for the specified annotation: " + annotation.getName()); throw new InjectionException("An injection processor does not exist for the specified annotation: " + annotation.getName()); } factories = new OverrideReferenceFactory[1]; factories[0] = factory; map.put(annotation, factories); } else { OverrideReferenceFactory<?>[] newFactories = new OverrideReferenceFactory[factories.length + 1]; System.arraycopy(factories, 0, newFactories, 0, factories.length); newFactories[factories.length] = factory; map.put(annotation, newFactories); } if (ivOverrideReferenceFactoryMapCopyOnWrite) // PM79779 F743-32696 { // Replace exiting map after all updates have been made. ivOverrideReferenceFactoryMap = map; ivOverrideReferenceFactoryMapCopyOnWrite = false; } } }
[ "@", "Override", "public", "<", "A", "extends", "Annotation", ">", "void", "registerOverrideReferenceFactory", "(", "Class", "<", "A", ">", "annotation", ",", "OverrideReferenceFactory", "<", "A", ">", "factory", ")", "throws", "InjectionException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"registerOverrideReferenceFactory\"", ",", "annotation", ",", "factory", ")", ";", "if", "(", "annotation", "==", "null", "||", "factory", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Null arguments are not allowed: \"", "+", "annotation", "+", "\", \"", "+", "factory", ")", ";", "}", "// Now add the new factory to the map, per annotation.", "synchronized", "(", "this", ")", "{", "HashMap", "<", "Class", "<", "?", "extends", "Annotation", ">", ",", "OverrideReferenceFactory", "<", "?", ">", "[", "]", ">", "map", "=", "ivOverrideReferenceFactoryMap", ";", "if", "(", "ivOverrideReferenceFactoryMapCopyOnWrite", ")", "// PM79779 F743-32696", "{", "HashMap", "<", "Class", "<", "?", "extends", "Annotation", ">", ",", "OverrideReferenceFactory", "<", "?", ">", "[", "]", ">", "newMap", "=", "new", "HashMap", "<", "Class", "<", "?", "extends", "Annotation", ">", ",", "OverrideReferenceFactory", "<", "?", ">", "[", "]", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Class", "<", "?", "extends", "Annotation", ">", ",", "OverrideReferenceFactory", "<", "?", ">", "[", "]", ">", "entry", ":", "map", ".", "entrySet", "(", ")", ")", "{", "OverrideReferenceFactory", "<", "?", ">", "[", "]", "value", "=", "entry", ".", "getValue", "(", ")", ";", "OverrideReferenceFactory", "<", "?", ">", "[", "]", "newValue", "=", "new", "OverrideReferenceFactory", "[", "value", ".", "length", "]", ";", "System", ".", "arraycopy", "(", "value", ",", "0", ",", "newValue", ",", "0", ",", "value", ".", "length", ")", ";", "newMap", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "newValue", ")", ";", "}", "map", "=", "newMap", ";", "}", "OverrideReferenceFactory", "<", "?", ">", "[", "]", "factories", "=", "map", ".", "get", "(", "annotation", ")", ";", "if", "(", "factories", "==", "null", ")", "{", "if", "(", "!", "ivProcessorProviders", ".", "containsKey", "(", "annotation", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"registerOverrideReferenceFactory: An injection \"", "+", "\"processor does not exist for the specified annotation: \"", "+", "annotation", ".", "getName", "(", ")", ")", ";", "throw", "new", "InjectionException", "(", "\"An injection processor does not exist for the specified annotation: \"", "+", "annotation", ".", "getName", "(", ")", ")", ";", "}", "factories", "=", "new", "OverrideReferenceFactory", "[", "1", "]", ";", "factories", "[", "0", "]", "=", "factory", ";", "map", ".", "put", "(", "annotation", ",", "factories", ")", ";", "}", "else", "{", "OverrideReferenceFactory", "<", "?", ">", "[", "]", "newFactories", "=", "new", "OverrideReferenceFactory", "[", "factories", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "factories", ",", "0", ",", "newFactories", ",", "0", ",", "factories", ".", "length", ")", ";", "newFactories", "[", "factories", ".", "length", "]", "=", "factory", ";", "map", ".", "put", "(", "annotation", ",", "newFactories", ")", ";", "}", "if", "(", "ivOverrideReferenceFactoryMapCopyOnWrite", ")", "// PM79779 F743-32696", "{", "// Replace exiting map after all updates have been made.", "ivOverrideReferenceFactoryMap", "=", "map", ";", "ivOverrideReferenceFactoryMapCopyOnWrite", "=", "false", ";", "}", "}", "}" ]
F1339-9050
[ "F1339", "-", "9050" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L1092-L1162
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.getOverrideReferenceFactories
@Override @SuppressWarnings("unchecked") public synchronized <A extends Annotation> OverrideReferenceFactory<A>[] getOverrideReferenceFactories(Class<A> klass) // F743-32443 { ivOverrideReferenceFactoryMapCopyOnWrite = true; // PM79779 return (OverrideReferenceFactory<A>[]) ivOverrideReferenceFactoryMap.get(klass); }
java
@Override @SuppressWarnings("unchecked") public synchronized <A extends Annotation> OverrideReferenceFactory<A>[] getOverrideReferenceFactories(Class<A> klass) // F743-32443 { ivOverrideReferenceFactoryMapCopyOnWrite = true; // PM79779 return (OverrideReferenceFactory<A>[]) ivOverrideReferenceFactoryMap.get(klass); }
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "synchronized", "<", "A", "extends", "Annotation", ">", "OverrideReferenceFactory", "<", "A", ">", "[", "]", "getOverrideReferenceFactories", "(", "Class", "<", "A", ">", "klass", ")", "// F743-32443", "{", "ivOverrideReferenceFactoryMapCopyOnWrite", "=", "true", ";", "// PM79779", "return", "(", "OverrideReferenceFactory", "<", "A", ">", "[", "]", ")", "ivOverrideReferenceFactoryMap", ".", "get", "(", "klass", ")", ";", "}" ]
Gets the list of override factories for the specified class. @param klass the class @return the list of override factories
[ "Gets", "the", "list", "of", "override", "factories", "for", "the", "specified", "class", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L1170-L1176
train
OpenLiberty/open-liberty
dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java
AbstractInjectionEngine.registerManagedBeanReferenceFactory
@Override public MBLinkReferenceFactory registerManagedBeanReferenceFactory(MBLinkReferenceFactory mbLinkRefFactory) { MBLinkReferenceFactory rtnFactory = DEFAULT_MBLinkRefFactory; ivMBLinkRefFactory = mbLinkRefFactory; // d703474 return rtnFactory; }
java
@Override public MBLinkReferenceFactory registerManagedBeanReferenceFactory(MBLinkReferenceFactory mbLinkRefFactory) { MBLinkReferenceFactory rtnFactory = DEFAULT_MBLinkRefFactory; ivMBLinkRefFactory = mbLinkRefFactory; // d703474 return rtnFactory; }
[ "@", "Override", "public", "MBLinkReferenceFactory", "registerManagedBeanReferenceFactory", "(", "MBLinkReferenceFactory", "mbLinkRefFactory", ")", "{", "MBLinkReferenceFactory", "rtnFactory", "=", "DEFAULT_MBLinkRefFactory", ";", "ivMBLinkRefFactory", "=", "mbLinkRefFactory", ";", "// d703474", "return", "rtnFactory", ";", "}" ]
d698540.1
[ "d698540", ".", "1" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L1212-L1218
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/FileSystem.java
FileSystem.walkPath
public static boolean walkPath(File appRoot, String relativePath) throws IOException { // Walk the path from the app root String[] relativePathElements = relativePath.replace(File.separatorChar, '/').split("/"); File currentPath = new File(appRoot.getCanonicalPath()); for (int i = 0; i < relativePathElements.length; i++) { // Handle urls which start with a "/" in whoich case split if (!relativePathElements[i].equals("")) { String[] entries = currentPath.list(new StrictFileNameFilter(relativePathElements[i])); if (entries==null || entries.length != 1) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) logger.logp(Level.FINE, CLASS_NAME,"uriCaseCheck",relativePathElements[i] + " not found."); return false; } currentPath = new File(currentPath, relativePathElements[i]); } } return true; }
java
public static boolean walkPath(File appRoot, String relativePath) throws IOException { // Walk the path from the app root String[] relativePathElements = relativePath.replace(File.separatorChar, '/').split("/"); File currentPath = new File(appRoot.getCanonicalPath()); for (int i = 0; i < relativePathElements.length; i++) { // Handle urls which start with a "/" in whoich case split if (!relativePathElements[i].equals("")) { String[] entries = currentPath.list(new StrictFileNameFilter(relativePathElements[i])); if (entries==null || entries.length != 1) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) logger.logp(Level.FINE, CLASS_NAME,"uriCaseCheck",relativePathElements[i] + " not found."); return false; } currentPath = new File(currentPath, relativePathElements[i]); } } return true; }
[ "public", "static", "boolean", "walkPath", "(", "File", "appRoot", ",", "String", "relativePath", ")", "throws", "IOException", "{", "// Walk the path from the app root", "String", "[", "]", "relativePathElements", "=", "relativePath", ".", "replace", "(", "File", ".", "separatorChar", ",", "'", "'", ")", ".", "split", "(", "\"/\"", ")", ";", "File", "currentPath", "=", "new", "File", "(", "appRoot", ".", "getCanonicalPath", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "relativePathElements", ".", "length", ";", "i", "++", ")", "{", "// Handle urls which start with a \"/\" in whoich case split ", "if", "(", "!", "relativePathElements", "[", "i", "]", ".", "equals", "(", "\"\"", ")", ")", "{", "String", "[", "]", "entries", "=", "currentPath", ".", "list", "(", "new", "StrictFileNameFilter", "(", "relativePathElements", "[", "i", "]", ")", ")", ";", "if", "(", "entries", "==", "null", "||", "entries", ".", "length", "!=", "1", ")", "{", "if", "(", "com", ".", "ibm", ".", "ejs", ".", "ras", ".", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "logger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "logger", ".", "logp", "(", "Level", ".", "FINE", ",", "CLASS_NAME", ",", "\"uriCaseCheck\"", ",", "relativePathElements", "[", "i", "]", "+", "\" not found.\"", ")", ";", "return", "false", ";", "}", "currentPath", "=", "new", "File", "(", "currentPath", ",", "relativePathElements", "[", "i", "]", ")", ";", "}", "}", "return", "true", ";", "}" ]
end 94578 Security Defect.
[ "end", "94578", "Security", "Defect", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/wsspi/webcontainer/util/FileSystem.java#L136-L153
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java
DurableOutputHandler.staticHandleControlMessage
public static void staticHandleControlMessage( ControlMessage cMsg, DestinationManager DM, MessageProcessor MP) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "staticHandleControlMessage", new Object[]{cMsg, DM, MP}); // This should be one of three requests: // 1) Request to create a durable subscription // 2) Request to delete a durable subscription // 3) Request to attach to an existing durable subscription // anything else causes an exception ControlMessageType type = cMsg.getControlMessageType(); if (type == ControlMessageType.CREATEDURABLE) handleCreateDurable(DM, (ControlCreateDurable) cMsg, MP); else if (type == ControlMessageType.DELETEDURABLE) handleDeleteDurable(DM, (ControlDeleteDurable) cMsg, MP); else if (type == ControlMessageType.CREATESTREAM) handleCreateStream(DM, (ControlCreateStream) cMsg, MP); else { // unknown type, log error SIErrorException e = new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.DurableOutputHandler", "1:173:1.45.1.1" }, null)); // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.staticHandleControlMessage", "1:180:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.DurableOutputHandler", "1:187:1.45.1.1" }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "staticHandleControlMessage", e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "staticHandleControlMessage"); }
java
public static void staticHandleControlMessage( ControlMessage cMsg, DestinationManager DM, MessageProcessor MP) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "staticHandleControlMessage", new Object[]{cMsg, DM, MP}); // This should be one of three requests: // 1) Request to create a durable subscription // 2) Request to delete a durable subscription // 3) Request to attach to an existing durable subscription // anything else causes an exception ControlMessageType type = cMsg.getControlMessageType(); if (type == ControlMessageType.CREATEDURABLE) handleCreateDurable(DM, (ControlCreateDurable) cMsg, MP); else if (type == ControlMessageType.DELETEDURABLE) handleDeleteDurable(DM, (ControlDeleteDurable) cMsg, MP); else if (type == ControlMessageType.CREATESTREAM) handleCreateStream(DM, (ControlCreateStream) cMsg, MP); else { // unknown type, log error SIErrorException e = new SIErrorException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.DurableOutputHandler", "1:173:1.45.1.1" }, null)); // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.staticHandleControlMessage", "1:180:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001", new Object[] { "com.ibm.ws.sib.processor.impl.DurableOutputHandler", "1:187:1.45.1.1" }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "staticHandleControlMessage", e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "staticHandleControlMessage"); }
[ "public", "static", "void", "staticHandleControlMessage", "(", "ControlMessage", "cMsg", ",", "DestinationManager", "DM", ",", "MessageProcessor", "MP", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"staticHandleControlMessage\"", ",", "new", "Object", "[", "]", "{", "cMsg", ",", "DM", ",", "MP", "}", ")", ";", "// This should be one of three requests:", "// 1) Request to create a durable subscription", "// 2) Request to delete a durable subscription", "// 3) Request to attach to an existing durable subscription", "// anything else causes an exception", "ControlMessageType", "type", "=", "cMsg", ".", "getControlMessageType", "(", ")", ";", "if", "(", "type", "==", "ControlMessageType", ".", "CREATEDURABLE", ")", "handleCreateDurable", "(", "DM", ",", "(", "ControlCreateDurable", ")", "cMsg", ",", "MP", ")", ";", "else", "if", "(", "type", "==", "ControlMessageType", ".", "DELETEDURABLE", ")", "handleDeleteDurable", "(", "DM", ",", "(", "ControlDeleteDurable", ")", "cMsg", ",", "MP", ")", ";", "else", "if", "(", "type", "==", "ControlMessageType", ".", "CREATESTREAM", ")", "handleCreateStream", "(", "DM", ",", "(", "ControlCreateStream", ")", "cMsg", ",", "MP", ")", ";", "else", "{", "// unknown type, log error", "SIErrorException", "e", "=", "new", "SIErrorException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.DurableOutputHandler\"", ",", "\"1:173:1.45.1.1\"", "}", ",", "null", ")", ")", ";", "// FFDC", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.DurableOutputHandler.staticHandleControlMessage\"", ",", "\"1:180:1.45.1.1\"", ",", "DurableOutputHandler", ".", "class", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.DurableOutputHandler\"", ",", "\"1:187:1.45.1.1\"", "}", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"staticHandleControlMessage\"", ",", "e", ")", ";", "throw", "e", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"staticHandleControlMessage\"", ")", ";", "}" ]
This is the only message handling method which should be invoked on the DurableOutputHandler. This method will receive control messages giving the status of durable subcription creation or deletion, as well as stream creation requests. @param sourceCellue The origin of the message. @param cMsg The ControlMessage to process.
[ "This", "is", "the", "only", "message", "handling", "method", "which", "should", "be", "invoked", "on", "the", "DurableOutputHandler", ".", "This", "method", "will", "receive", "control", "messages", "giving", "the", "status", "of", "durable", "subcription", "creation", "or", "deletion", "as", "well", "as", "stream", "creation", "requests", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java#L120-L174
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java
DurableOutputHandler.handleCreateDurable
protected static void handleCreateDurable( DestinationManager DM, ControlCreateDurable msg, MessageProcessor MP) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleCreateDurable", new Object[] {DM, msg, MP}); int status = STATUS_SUB_GENERAL_ERROR; SIBUuid12 handlerID = msg.getGuaranteedTargetDestinationDefinitionUUID(); // create requests require a target dest ID String subName = msg.getDurableSubName(); String discriminator = msg.getDurableDiscriminator(); String selectorString = msg.getDurableSelector(); SelectorDomain selectorDomain = SelectorDomain. getSelectorDomain(msg.getDurableSelectorDomain()); // Create a selectorProperties Map to convey any additional properties associated // with the selector. At present (26/03/08) there is only one additional property // which is itself a map (of name spaces). The name space map is used in the XPath10 selector domain // to map URLs to prefixes. The use of a selectorProperties map keeps the Core SPI generic but // when conveying information over JMF we need a simpler structure and so will need to // break out individual properties for transportation. Map<String, Object> selectorProperties = null; Map<String, String> selectorNamespaceMap = msg.getDurableSelectorNamespaceMap(); if(selectorNamespaceMap != null) { selectorProperties = new HashMap<String, Object>(); selectorProperties.put("namespacePrefixMappings", selectorNamespaceMap); } String user = msg.getSecurityUserid(); //TODO this flag needs to be set from the message. boolean isSIBServerSubject = msg.isSecurityUseridSentBySystem(); try { // Resolve the target BaseDestinationHandler BaseDestinationHandler handler = (BaseDestinationHandler) DM.getDestination(handlerID, false); // We'll create SelectionCriteria based on the properties we've been passed. SelectionCriteria criteria = null; // Use the appropriate SelectionCriteria factory dependent on whether we've been passed // selectorProperties if(selectorProperties == null) { criteria = MP.getSelectionCriteriaFactory(). createSelectionCriteria(discriminator, selectorString, selectorDomain); } else { // Non-null selectorProperties, so we create MPSelectionCriteria criteria = MPSelectionCriteriaFactory. getInstance(). createSelectionCriteria(discriminator, selectorString, selectorDomain, selectorProperties); } // Ask the BaseDestinationHandler to attempt the create // then we send back the result. status = handler.createDurableFromRemote(subName, criteria, user, msg.isCloned(), msg.isNoLocal(), isSIBServerSubject); } catch (Exception e) { // Log the exception FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.handleCreateDurable", "1:281:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); } // Forward the status to the caller and we're done SIBUuid8 sender = msg.getGuaranteedSourceMessagingEngineUUID(); ControlDurableConfirm reply = createDurableConfirm(MP, sender, msg.getRequestID(), status); MP.getMPIO().sendToMe(sender, SIMPConstants.CONTROL_MESSAGE_PRIORITY, reply); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleCreateDurable"); }
java
protected static void handleCreateDurable( DestinationManager DM, ControlCreateDurable msg, MessageProcessor MP) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleCreateDurable", new Object[] {DM, msg, MP}); int status = STATUS_SUB_GENERAL_ERROR; SIBUuid12 handlerID = msg.getGuaranteedTargetDestinationDefinitionUUID(); // create requests require a target dest ID String subName = msg.getDurableSubName(); String discriminator = msg.getDurableDiscriminator(); String selectorString = msg.getDurableSelector(); SelectorDomain selectorDomain = SelectorDomain. getSelectorDomain(msg.getDurableSelectorDomain()); // Create a selectorProperties Map to convey any additional properties associated // with the selector. At present (26/03/08) there is only one additional property // which is itself a map (of name spaces). The name space map is used in the XPath10 selector domain // to map URLs to prefixes. The use of a selectorProperties map keeps the Core SPI generic but // when conveying information over JMF we need a simpler structure and so will need to // break out individual properties for transportation. Map<String, Object> selectorProperties = null; Map<String, String> selectorNamespaceMap = msg.getDurableSelectorNamespaceMap(); if(selectorNamespaceMap != null) { selectorProperties = new HashMap<String, Object>(); selectorProperties.put("namespacePrefixMappings", selectorNamespaceMap); } String user = msg.getSecurityUserid(); //TODO this flag needs to be set from the message. boolean isSIBServerSubject = msg.isSecurityUseridSentBySystem(); try { // Resolve the target BaseDestinationHandler BaseDestinationHandler handler = (BaseDestinationHandler) DM.getDestination(handlerID, false); // We'll create SelectionCriteria based on the properties we've been passed. SelectionCriteria criteria = null; // Use the appropriate SelectionCriteria factory dependent on whether we've been passed // selectorProperties if(selectorProperties == null) { criteria = MP.getSelectionCriteriaFactory(). createSelectionCriteria(discriminator, selectorString, selectorDomain); } else { // Non-null selectorProperties, so we create MPSelectionCriteria criteria = MPSelectionCriteriaFactory. getInstance(). createSelectionCriteria(discriminator, selectorString, selectorDomain, selectorProperties); } // Ask the BaseDestinationHandler to attempt the create // then we send back the result. status = handler.createDurableFromRemote(subName, criteria, user, msg.isCloned(), msg.isNoLocal(), isSIBServerSubject); } catch (Exception e) { // Log the exception FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.handleCreateDurable", "1:281:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); } // Forward the status to the caller and we're done SIBUuid8 sender = msg.getGuaranteedSourceMessagingEngineUUID(); ControlDurableConfirm reply = createDurableConfirm(MP, sender, msg.getRequestID(), status); MP.getMPIO().sendToMe(sender, SIMPConstants.CONTROL_MESSAGE_PRIORITY, reply); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleCreateDurable"); }
[ "protected", "static", "void", "handleCreateDurable", "(", "DestinationManager", "DM", ",", "ControlCreateDurable", "msg", ",", "MessageProcessor", "MP", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"handleCreateDurable\"", ",", "new", "Object", "[", "]", "{", "DM", ",", "msg", ",", "MP", "}", ")", ";", "int", "status", "=", "STATUS_SUB_GENERAL_ERROR", ";", "SIBUuid12", "handlerID", "=", "msg", ".", "getGuaranteedTargetDestinationDefinitionUUID", "(", ")", ";", "// create requests require a target dest ID", "String", "subName", "=", "msg", ".", "getDurableSubName", "(", ")", ";", "String", "discriminator", "=", "msg", ".", "getDurableDiscriminator", "(", ")", ";", "String", "selectorString", "=", "msg", ".", "getDurableSelector", "(", ")", ";", "SelectorDomain", "selectorDomain", "=", "SelectorDomain", ".", "getSelectorDomain", "(", "msg", ".", "getDurableSelectorDomain", "(", ")", ")", ";", "// Create a selectorProperties Map to convey any additional properties associated", "// with the selector. At present (26/03/08) there is only one additional property", "// which is itself a map (of name spaces). The name space map is used in the XPath10 selector domain", "// to map URLs to prefixes. The use of a selectorProperties map keeps the Core SPI generic but", "// when conveying information over JMF we need a simpler structure and so will need to", "// break out individual properties for transportation.", "Map", "<", "String", ",", "Object", ">", "selectorProperties", "=", "null", ";", "Map", "<", "String", ",", "String", ">", "selectorNamespaceMap", "=", "msg", ".", "getDurableSelectorNamespaceMap", "(", ")", ";", "if", "(", "selectorNamespaceMap", "!=", "null", ")", "{", "selectorProperties", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "selectorProperties", ".", "put", "(", "\"namespacePrefixMappings\"", ",", "selectorNamespaceMap", ")", ";", "}", "String", "user", "=", "msg", ".", "getSecurityUserid", "(", ")", ";", "//TODO this flag needs to be set from the message.", "boolean", "isSIBServerSubject", "=", "msg", ".", "isSecurityUseridSentBySystem", "(", ")", ";", "try", "{", "// Resolve the target BaseDestinationHandler", "BaseDestinationHandler", "handler", "=", "(", "BaseDestinationHandler", ")", "DM", ".", "getDestination", "(", "handlerID", ",", "false", ")", ";", "// We'll create SelectionCriteria based on the properties we've been passed.", "SelectionCriteria", "criteria", "=", "null", ";", "// Use the appropriate SelectionCriteria factory dependent on whether we've been passed", "// selectorProperties", "if", "(", "selectorProperties", "==", "null", ")", "{", "criteria", "=", "MP", ".", "getSelectionCriteriaFactory", "(", ")", ".", "createSelectionCriteria", "(", "discriminator", ",", "selectorString", ",", "selectorDomain", ")", ";", "}", "else", "{", "// Non-null selectorProperties, so we create MPSelectionCriteria", "criteria", "=", "MPSelectionCriteriaFactory", ".", "getInstance", "(", ")", ".", "createSelectionCriteria", "(", "discriminator", ",", "selectorString", ",", "selectorDomain", ",", "selectorProperties", ")", ";", "}", "// Ask the BaseDestinationHandler to attempt the create", "// then we send back the result.", "status", "=", "handler", ".", "createDurableFromRemote", "(", "subName", ",", "criteria", ",", "user", ",", "msg", ".", "isCloned", "(", ")", ",", "msg", ".", "isNoLocal", "(", ")", ",", "isSIBServerSubject", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "// Log the exception", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.DurableOutputHandler.handleCreateDurable\"", ",", "\"1:281:1.45.1.1\"", ",", "DurableOutputHandler", ".", "class", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "}", "// Forward the status to the caller and we're done", "SIBUuid8", "sender", "=", "msg", ".", "getGuaranteedSourceMessagingEngineUUID", "(", ")", ";", "ControlDurableConfirm", "reply", "=", "createDurableConfirm", "(", "MP", ",", "sender", ",", "msg", ".", "getRequestID", "(", ")", ",", "status", ")", ";", "MP", ".", "getMPIO", "(", ")", ".", "sendToMe", "(", "sender", ",", "SIMPConstants", ".", "CONTROL_MESSAGE_PRIORITY", ",", "reply", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"handleCreateDurable\"", ")", ";", "}" ]
Attempt to create a new durable subscription and send back either a ControlDurableConfirm giving the result. @param msg The ControlCreateDurable request message.
[ "Attempt", "to", "create", "a", "new", "durable", "subscription", "and", "send", "back", "either", "a", "ControlDurableConfirm", "giving", "the", "result", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java#L182-L272
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java
DurableOutputHandler.handleDeleteDurable
protected static void handleDeleteDurable( DestinationManager DM, ControlDeleteDurable msg, MessageProcessor MP) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleDeleteDurable", new Object[] {DM, msg, MP}); int status = STATUS_SUB_GENERAL_ERROR; try { // Track down a handler for this durable sub, error if we can't find one String subName = msg.getDurableSubName(); HashMap durableSubs = DM.getDurableSubscriptionsTable(); synchronized (durableSubs) { //Look up the consumer dispatcher for this subId in the system durable subs list ConsumerDispatcher cd = (ConsumerDispatcher) durableSubs.get(subName); // Check that the durable subscription existed if (cd == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleDeleteDurable", "SIDurableSubscriptionNotFoundException"); status = DurableConstants.STATUS_SUB_NOT_FOUND; throw new SIDurableSubscriptionNotFoundException( nls.getFormattedMessage( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072", new Object[] { subName, MP.getMessagingEngineName() }, null)); } // Obtain the destination from the consumer dispatcher // A cast error here will result in an error sent back to the caller BaseDestinationHandler handler = cd.getDestination(); boolean userMatch = true; // If security is disabled then we'll bypass the check if(MP.isBusSecure()) { // Check that the user who is attempting to delete this durable subscription // matches that set in the CD state when the subscription was created ConsumerDispatcherState subState = cd.getConsumerDispatcherState(); String theUser = msg.getSecurityUserid(); if(theUser == null) { if(subState.getUser() != null) userMatch = false; } else { if (!theUser.equals(subState.getUser())) userMatch = false; } } // Handle the case where the users do not match if (!userMatch) { status = DurableConstants.STATUS_NOT_AUTH_ERROR; } else { status = handler.deleteDurableFromRemote(subName); } } } catch (SIDurableSubscriptionNotFoundException e) { // No FFDC code needed SibTr.exception(tc, e); } catch (Exception e) { // FFDC // Any other exception is unexpected FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.handleDeleteDurable", "1:387:1.45.1.1", DurableOutputHandler.class); } // Forward the status to the caller and we're done SIBUuid8 sender = msg.getGuaranteedSourceMessagingEngineUUID(); ControlDurableConfirm reply = createDurableConfirm(MP, sender, msg.getRequestID(), status); MP.getMPIO().sendToMe(sender, SIMPConstants.CONTROL_MESSAGE_PRIORITY, reply); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleDeleteDurable"); }
java
protected static void handleDeleteDurable( DestinationManager DM, ControlDeleteDurable msg, MessageProcessor MP) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleDeleteDurable", new Object[] {DM, msg, MP}); int status = STATUS_SUB_GENERAL_ERROR; try { // Track down a handler for this durable sub, error if we can't find one String subName = msg.getDurableSubName(); HashMap durableSubs = DM.getDurableSubscriptionsTable(); synchronized (durableSubs) { //Look up the consumer dispatcher for this subId in the system durable subs list ConsumerDispatcher cd = (ConsumerDispatcher) durableSubs.get(subName); // Check that the durable subscription existed if (cd == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleDeleteDurable", "SIDurableSubscriptionNotFoundException"); status = DurableConstants.STATUS_SUB_NOT_FOUND; throw new SIDurableSubscriptionNotFoundException( nls.getFormattedMessage( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072", new Object[] { subName, MP.getMessagingEngineName() }, null)); } // Obtain the destination from the consumer dispatcher // A cast error here will result in an error sent back to the caller BaseDestinationHandler handler = cd.getDestination(); boolean userMatch = true; // If security is disabled then we'll bypass the check if(MP.isBusSecure()) { // Check that the user who is attempting to delete this durable subscription // matches that set in the CD state when the subscription was created ConsumerDispatcherState subState = cd.getConsumerDispatcherState(); String theUser = msg.getSecurityUserid(); if(theUser == null) { if(subState.getUser() != null) userMatch = false; } else { if (!theUser.equals(subState.getUser())) userMatch = false; } } // Handle the case where the users do not match if (!userMatch) { status = DurableConstants.STATUS_NOT_AUTH_ERROR; } else { status = handler.deleteDurableFromRemote(subName); } } } catch (SIDurableSubscriptionNotFoundException e) { // No FFDC code needed SibTr.exception(tc, e); } catch (Exception e) { // FFDC // Any other exception is unexpected FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.handleDeleteDurable", "1:387:1.45.1.1", DurableOutputHandler.class); } // Forward the status to the caller and we're done SIBUuid8 sender = msg.getGuaranteedSourceMessagingEngineUUID(); ControlDurableConfirm reply = createDurableConfirm(MP, sender, msg.getRequestID(), status); MP.getMPIO().sendToMe(sender, SIMPConstants.CONTROL_MESSAGE_PRIORITY, reply); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleDeleteDurable"); }
[ "protected", "static", "void", "handleDeleteDurable", "(", "DestinationManager", "DM", ",", "ControlDeleteDurable", "msg", ",", "MessageProcessor", "MP", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"handleDeleteDurable\"", ",", "new", "Object", "[", "]", "{", "DM", ",", "msg", ",", "MP", "}", ")", ";", "int", "status", "=", "STATUS_SUB_GENERAL_ERROR", ";", "try", "{", "// Track down a handler for this durable sub, error if we can't find one", "String", "subName", "=", "msg", ".", "getDurableSubName", "(", ")", ";", "HashMap", "durableSubs", "=", "DM", ".", "getDurableSubscriptionsTable", "(", ")", ";", "synchronized", "(", "durableSubs", ")", "{", "//Look up the consumer dispatcher for this subId in the system durable subs list", "ConsumerDispatcher", "cd", "=", "(", "ConsumerDispatcher", ")", "durableSubs", ".", "get", "(", "subName", ")", ";", "// Check that the durable subscription existed", "if", "(", "cd", "==", "null", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"handleDeleteDurable\"", ",", "\"SIDurableSubscriptionNotFoundException\"", ")", ";", "status", "=", "DurableConstants", ".", "STATUS_SUB_NOT_FOUND", ";", "throw", "new", "SIDurableSubscriptionNotFoundException", "(", "nls", ".", "getFormattedMessage", "(", "\"SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072\"", ",", "new", "Object", "[", "]", "{", "subName", ",", "MP", ".", "getMessagingEngineName", "(", ")", "}", ",", "null", ")", ")", ";", "}", "// Obtain the destination from the consumer dispatcher", "// A cast error here will result in an error sent back to the caller", "BaseDestinationHandler", "handler", "=", "cd", ".", "getDestination", "(", ")", ";", "boolean", "userMatch", "=", "true", ";", "// If security is disabled then we'll bypass the check", "if", "(", "MP", ".", "isBusSecure", "(", ")", ")", "{", "// Check that the user who is attempting to delete this durable subscription", "// matches that set in the CD state when the subscription was created", "ConsumerDispatcherState", "subState", "=", "cd", ".", "getConsumerDispatcherState", "(", ")", ";", "String", "theUser", "=", "msg", ".", "getSecurityUserid", "(", ")", ";", "if", "(", "theUser", "==", "null", ")", "{", "if", "(", "subState", ".", "getUser", "(", ")", "!=", "null", ")", "userMatch", "=", "false", ";", "}", "else", "{", "if", "(", "!", "theUser", ".", "equals", "(", "subState", ".", "getUser", "(", ")", ")", ")", "userMatch", "=", "false", ";", "}", "}", "// Handle the case where the users do not match", "if", "(", "!", "userMatch", ")", "{", "status", "=", "DurableConstants", ".", "STATUS_NOT_AUTH_ERROR", ";", "}", "else", "{", "status", "=", "handler", ".", "deleteDurableFromRemote", "(", "subName", ")", ";", "}", "}", "}", "catch", "(", "SIDurableSubscriptionNotFoundException", "e", ")", "{", "// No FFDC code needed", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "// FFDC", "// Any other exception is unexpected", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.DurableOutputHandler.handleDeleteDurable\"", ",", "\"1:387:1.45.1.1\"", ",", "DurableOutputHandler", ".", "class", ")", ";", "}", "// Forward the status to the caller and we're done", "SIBUuid8", "sender", "=", "msg", ".", "getGuaranteedSourceMessagingEngineUUID", "(", ")", ";", "ControlDurableConfirm", "reply", "=", "createDurableConfirm", "(", "MP", ",", "sender", ",", "msg", ".", "getRequestID", "(", ")", ",", "status", ")", ";", "MP", ".", "getMPIO", "(", ")", ".", "sendToMe", "(", "sender", ",", "SIMPConstants", ".", "CONTROL_MESSAGE_PRIORITY", ",", "reply", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"handleDeleteDurable\"", ")", ";", "}" ]
Attempt to delete the durable subscription specified by the sender and send back a ControlDurableConfirm giving the result. @param msg The ControlDeleteDurable request message.
[ "Attempt", "to", "delete", "the", "durable", "subscription", "specified", "by", "the", "sender", "and", "send", "back", "a", "ControlDurableConfirm", "giving", "the", "result", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java#L280-L376
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java
DurableOutputHandler.createDurableConfirm
protected static ControlDurableConfirm createDurableConfirm( MessageProcessor MP, SIBUuid8 target, long reqID, int status) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createDurableConfirm", new Object[] {MP, target, new Long(reqID), new Integer(status)}); ControlDurableConfirm msg = null; try { // Create and initialize the message msg = MessageProcessor.getControlMessageFactory().createNewControlDurableConfirm(); initializeControlMessage(MP.getMessagingEngineUuid(), msg, target); // Parameterize for CreateStream msg.setRequestID(reqID); msg.setStatus(status); } catch (Exception e) { FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.createDurableConfirm", "1:509:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createDurableConfirm", msg); return msg; }
java
protected static ControlDurableConfirm createDurableConfirm( MessageProcessor MP, SIBUuid8 target, long reqID, int status) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createDurableConfirm", new Object[] {MP, target, new Long(reqID), new Integer(status)}); ControlDurableConfirm msg = null; try { // Create and initialize the message msg = MessageProcessor.getControlMessageFactory().createNewControlDurableConfirm(); initializeControlMessage(MP.getMessagingEngineUuid(), msg, target); // Parameterize for CreateStream msg.setRequestID(reqID); msg.setStatus(status); } catch (Exception e) { FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.createDurableConfirm", "1:509:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createDurableConfirm", msg); return msg; }
[ "protected", "static", "ControlDurableConfirm", "createDurableConfirm", "(", "MessageProcessor", "MP", ",", "SIBUuid8", "target", ",", "long", "reqID", ",", "int", "status", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createDurableConfirm\"", ",", "new", "Object", "[", "]", "{", "MP", ",", "target", ",", "new", "Long", "(", "reqID", ")", ",", "new", "Integer", "(", "status", ")", "}", ")", ";", "ControlDurableConfirm", "msg", "=", "null", ";", "try", "{", "// Create and initialize the message", "msg", "=", "MessageProcessor", ".", "getControlMessageFactory", "(", ")", ".", "createNewControlDurableConfirm", "(", ")", ";", "initializeControlMessage", "(", "MP", ".", "getMessagingEngineUuid", "(", ")", ",", "msg", ",", "target", ")", ";", "// Parameterize for CreateStream", "msg", ".", "setRequestID", "(", "reqID", ")", ";", "msg", ".", "setStatus", "(", "status", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.DurableOutputHandler.createDurableConfirm\"", ",", "\"1:509:1.45.1.1\"", ",", "DurableOutputHandler", ".", "class", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createDurableConfirm\"", ",", "msg", ")", ";", "return", "msg", ";", "}" ]
Create a DurableConfirm reply. @param target The target ME for the message. @param reqID The request ID of the original request message. @param status The status to record in this reply.
[ "Create", "a", "DurableConfirm", "reply", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java#L462-L496
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java
DurableOutputHandler.createCardinalityInfo
protected static ControlCardinalityInfo createCardinalityInfo( MessageProcessor MP, SIBUuid8 target, long reqID, int card) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createCardinalityInfo", new Object[] {MP, target, new Long(reqID), new Integer(card)}); ControlCardinalityInfo msg = null; try { // Create and initialize the message msg = MessageProcessor.getControlMessageFactory().createNewControlCardinalityInfo(); initializeControlMessage(MP.getMessagingEngineUuid(), msg, target); // Parameterize for CreateStream msg.setRequestID(reqID); msg.setCardinality(card); } catch (Exception e) { FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.createCardinalityInfo", "1:552:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createCardinalityInfo", msg); return msg; }
java
protected static ControlCardinalityInfo createCardinalityInfo( MessageProcessor MP, SIBUuid8 target, long reqID, int card) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createCardinalityInfo", new Object[] {MP, target, new Long(reqID), new Integer(card)}); ControlCardinalityInfo msg = null; try { // Create and initialize the message msg = MessageProcessor.getControlMessageFactory().createNewControlCardinalityInfo(); initializeControlMessage(MP.getMessagingEngineUuid(), msg, target); // Parameterize for CreateStream msg.setRequestID(reqID); msg.setCardinality(card); } catch (Exception e) { FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.DurableOutputHandler.createCardinalityInfo", "1:552:1.45.1.1", DurableOutputHandler.class); SibTr.exception(tc, e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createCardinalityInfo", msg); return msg; }
[ "protected", "static", "ControlCardinalityInfo", "createCardinalityInfo", "(", "MessageProcessor", "MP", ",", "SIBUuid8", "target", ",", "long", "reqID", ",", "int", "card", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createCardinalityInfo\"", ",", "new", "Object", "[", "]", "{", "MP", ",", "target", ",", "new", "Long", "(", "reqID", ")", ",", "new", "Integer", "(", "card", ")", "}", ")", ";", "ControlCardinalityInfo", "msg", "=", "null", ";", "try", "{", "// Create and initialize the message", "msg", "=", "MessageProcessor", ".", "getControlMessageFactory", "(", ")", ".", "createNewControlCardinalityInfo", "(", ")", ";", "initializeControlMessage", "(", "MP", ".", "getMessagingEngineUuid", "(", ")", ",", "msg", ",", "target", ")", ";", "// Parameterize for CreateStream", "msg", ".", "setRequestID", "(", "reqID", ")", ";", "msg", ".", "setCardinality", "(", "card", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.DurableOutputHandler.createCardinalityInfo\"", ",", "\"1:552:1.45.1.1\"", ",", "DurableOutputHandler", ".", "class", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createCardinalityInfo\"", ",", "msg", ")", ";", "return", "msg", ";", "}" ]
Create a CardinalityInfo reply. @param target The target ME for this reply. @param reqID The request ID of the original request message. @param card The cardinality to record on this message.
[ "Create", "a", "CardinalityInfo", "reply", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java#L505-L539
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java
DurableOutputHandler.initializeControlMessage
protected static void initializeControlMessage(SIBUuid8 sourceME, ControlMessage msg, SIBUuid8 remoteMEId) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "initializeControlMessage", new Object[] {msg, remoteMEId}); SIMPUtils.setGuaranteedDeliveryProperties(msg, sourceME, remoteMEId, null, null, null, ProtocolType.DURABLEINPUT, GDConfig.PROTOCOL_VERSION); msg.setPriority(SIMPConstants.CONTROL_MESSAGE_PRIORITY); msg.setReliability(SIMPConstants.CONTROL_MESSAGE_RELIABILITY); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initializeControlMessage"); }
java
protected static void initializeControlMessage(SIBUuid8 sourceME, ControlMessage msg, SIBUuid8 remoteMEId) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "initializeControlMessage", new Object[] {msg, remoteMEId}); SIMPUtils.setGuaranteedDeliveryProperties(msg, sourceME, remoteMEId, null, null, null, ProtocolType.DURABLEINPUT, GDConfig.PROTOCOL_VERSION); msg.setPriority(SIMPConstants.CONTROL_MESSAGE_PRIORITY); msg.setReliability(SIMPConstants.CONTROL_MESSAGE_RELIABILITY); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initializeControlMessage"); }
[ "protected", "static", "void", "initializeControlMessage", "(", "SIBUuid8", "sourceME", ",", "ControlMessage", "msg", ",", "SIBUuid8", "remoteMEId", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"initializeControlMessage\"", ",", "new", "Object", "[", "]", "{", "msg", ",", "remoteMEId", "}", ")", ";", "SIMPUtils", ".", "setGuaranteedDeliveryProperties", "(", "msg", ",", "sourceME", ",", "remoteMEId", ",", "null", ",", "null", ",", "null", ",", "ProtocolType", ".", "DURABLEINPUT", ",", "GDConfig", ".", "PROTOCOL_VERSION", ")", ";", "msg", ".", "setPriority", "(", "SIMPConstants", ".", "CONTROL_MESSAGE_PRIORITY", ")", ";", "msg", ".", "setReliability", "(", "SIMPConstants", ".", "CONTROL_MESSAGE_RELIABILITY", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"initializeControlMessage\"", ")", ";", "}" ]
Common initialization for all messages sent by the DurableOutputHandler. @param msg Message to initialize. @param remoteMEId The ME the message will be sent to.
[ "Common", "initialization", "for", "all", "messages", "sent", "by", "the", "DurableOutputHandler", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableOutputHandler.java#L547-L566
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java
ConnectionManager.associateConnection
private void associateConnection(ManagedConnectionFactory mcf, Subject subject, ConnectionRequestInfo cri, Object connection) throws ResourceException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(this, tc, "associateConnection"); UOWCurrent uowCurrent = (UOWCurrent) _pm.connectorSvc.transactionManager; UOWCoordinator uowCoord = uowCurrent == null ? null : uowCurrent.getUOWCoord(); MCWrapper mcWrapper = null; Object credTokenObj = null; try { // Begin processing to get connection // Perform any security setup that may be needed // before we proceed to get a connection. credTokenObj = securityHelper.beforeGettingConnection(subject, cri); // Get an appropriate wrappered ManangedConnection. mcWrapper = allocateMCWrapper(mcf, cri, subject, uowCoord); } // end try block finally { // A "finally" clause is implemented to ensure // any thread identity pushed to the OS // thread is removed and the original identity // is restored. if (credTokenObj != null) { securityHelper.afterGettingConnection(subject, cri, credTokenObj); } } involveMCInTran(mcWrapper, uowCoord, this); // Reassociate the handle which was passed in with the ManagedConnection (via MCWrapper). // Note: since associateConnection is called to reassociate a smart handle which is // currently not associated to any MC, the fromMCWrapper parm in the call below will // be null. reassociateConnectionHandle(connection, null, mcWrapper, uowCoord); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(this, tc, "associateConnection"); }
java
private void associateConnection(ManagedConnectionFactory mcf, Subject subject, ConnectionRequestInfo cri, Object connection) throws ResourceException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(this, tc, "associateConnection"); UOWCurrent uowCurrent = (UOWCurrent) _pm.connectorSvc.transactionManager; UOWCoordinator uowCoord = uowCurrent == null ? null : uowCurrent.getUOWCoord(); MCWrapper mcWrapper = null; Object credTokenObj = null; try { // Begin processing to get connection // Perform any security setup that may be needed // before we proceed to get a connection. credTokenObj = securityHelper.beforeGettingConnection(subject, cri); // Get an appropriate wrappered ManangedConnection. mcWrapper = allocateMCWrapper(mcf, cri, subject, uowCoord); } // end try block finally { // A "finally" clause is implemented to ensure // any thread identity pushed to the OS // thread is removed and the original identity // is restored. if (credTokenObj != null) { securityHelper.afterGettingConnection(subject, cri, credTokenObj); } } involveMCInTran(mcWrapper, uowCoord, this); // Reassociate the handle which was passed in with the ManagedConnection (via MCWrapper). // Note: since associateConnection is called to reassociate a smart handle which is // currently not associated to any MC, the fromMCWrapper parm in the call below will // be null. reassociateConnectionHandle(connection, null, mcWrapper, uowCoord); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(this, tc, "associateConnection"); }
[ "private", "void", "associateConnection", "(", "ManagedConnectionFactory", "mcf", ",", "Subject", "subject", ",", "ConnectionRequestInfo", "cri", ",", "Object", "connection", ")", "throws", "ResourceException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "this", ",", "tc", ",", "\"associateConnection\"", ")", ";", "UOWCurrent", "uowCurrent", "=", "(", "UOWCurrent", ")", "_pm", ".", "connectorSvc", ".", "transactionManager", ";", "UOWCoordinator", "uowCoord", "=", "uowCurrent", "==", "null", "?", "null", ":", "uowCurrent", ".", "getUOWCoord", "(", ")", ";", "MCWrapper", "mcWrapper", "=", "null", ";", "Object", "credTokenObj", "=", "null", ";", "try", "{", "// Begin processing to get connection", "// Perform any security setup that may be needed", "// before we proceed to get a connection.", "credTokenObj", "=", "securityHelper", ".", "beforeGettingConnection", "(", "subject", ",", "cri", ")", ";", "// Get an appropriate wrappered ManangedConnection.", "mcWrapper", "=", "allocateMCWrapper", "(", "mcf", ",", "cri", ",", "subject", ",", "uowCoord", ")", ";", "}", "// end try block", "finally", "{", "// A \"finally\" clause is implemented to ensure", "// any thread identity pushed to the OS", "// thread is removed and the original identity", "// is restored.", "if", "(", "credTokenObj", "!=", "null", ")", "{", "securityHelper", ".", "afterGettingConnection", "(", "subject", ",", "cri", ",", "credTokenObj", ")", ";", "}", "}", "involveMCInTran", "(", "mcWrapper", ",", "uowCoord", ",", "this", ")", ";", "// Reassociate the handle which was passed in with the ManagedConnection (via MCWrapper).", "// Note: since associateConnection is called to reassociate a smart handle which is", "// currently not associated to any MC, the fromMCWrapper parm in the call below will", "// be null.", "reassociateConnectionHandle", "(", "connection", ",", "null", ",", "mcWrapper", ",", "uowCoord", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "this", ",", "tc", ",", "\"associateConnection\"", ")", ";", "}" ]
not associated with a connection to get reassociated with a valid connection.
[ "not", "associated", "with", "a", "connection", "to", "get", "reassociated", "with", "a", "valid", "connection", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1311-L1358
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java
ConnectionManager.reassociateConnectionHandle
private void reassociateConnectionHandle(Object connection, MCWrapper fromMCWrapper, MCWrapper toMCWrapper, UOWCoordinator uowCoord) throws ResourceException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(this, tc, "reassociateConnectionHandle"); try { toMCWrapper.associateConnection(connection, fromMCWrapper); } catch (ResourceException e) { /* * If the Resource Adapter throws a ResourceException and we are not in a * transaction and there are no other connections open on the ManagedConnection, * return the ManagedConnection to the pool before * rethrowing the exception. The ManagedConnection is probably OK - the exception * may only be a logon failure or similar so the MC shouldn't be 'lost'. * * If we are in a transaction, just throw the exception. Assume we will cleanup during * the aftercompletion call on the tran wrapper. */ com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "479", this); if (uowCoord == null && toMCWrapper.getHandleCount() == 0) { try { toMCWrapper.releaseToPoolManager(); } catch (Exception exp) { // don't rethrow, already on exception path com.ibm.ws.ffdc.FFDCFilter.processException(exp, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "487", this); //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.error(tc, "FAILED_CONNECTION_RELEASE_J2CA0022", new Object[] { exp, toMCWrapper.gConfigProps.cfName }); } } throw e; } catch (java.lang.Exception e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "495", this); if (isTraceOn && tc.isDebugEnabled()) { Tr.debug(this, tc, "reassociateConnectionHandle: Caught a Non resource exception from mc.associateConnection()"); } Tr.error(tc, "FAILED_CONNECTION_J2CA0021", new Object[] { e, toMCWrapper.gConfigProps.cfName }); /* * If the Resource Adapter throws an Exception and we are not in a * transaction and there are no other connections open on the ManagedConnection, * return the ManagedConnection to the pool before * rethrowing the exception. The ManagedConnection is probably OK - the exception * may only be a logon failure or similar so the MC shouldn't be 'lost'. * * If we are in a transaction, just throw the exception. Assume we will cleanup during * the aftercompletion call on the tran wrapper. */ if (uowCoord == null && toMCWrapper.getHandleCount() == 0) { try { toMCWrapper.releaseToPoolManager(); } catch (Exception exp) { // don't rethrow, already on exception path com.ibm.ws.ffdc.FFDCFilter.processException(exp, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "518", this); //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.error(tc, "FAILED_CONNECTION_RELEASE_J2CA0022", new Object[] { exp, toMCWrapper.gConfigProps.cfName }); } } ResourceException re = new ResourceException("reassociateConnectionHandle: caught Exception"); re.initCause(e); throw re; } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(this, tc, "reassociateConnectionHandle"); }
java
private void reassociateConnectionHandle(Object connection, MCWrapper fromMCWrapper, MCWrapper toMCWrapper, UOWCoordinator uowCoord) throws ResourceException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(this, tc, "reassociateConnectionHandle"); try { toMCWrapper.associateConnection(connection, fromMCWrapper); } catch (ResourceException e) { /* * If the Resource Adapter throws a ResourceException and we are not in a * transaction and there are no other connections open on the ManagedConnection, * return the ManagedConnection to the pool before * rethrowing the exception. The ManagedConnection is probably OK - the exception * may only be a logon failure or similar so the MC shouldn't be 'lost'. * * If we are in a transaction, just throw the exception. Assume we will cleanup during * the aftercompletion call on the tran wrapper. */ com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "479", this); if (uowCoord == null && toMCWrapper.getHandleCount() == 0) { try { toMCWrapper.releaseToPoolManager(); } catch (Exception exp) { // don't rethrow, already on exception path com.ibm.ws.ffdc.FFDCFilter.processException(exp, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "487", this); //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.error(tc, "FAILED_CONNECTION_RELEASE_J2CA0022", new Object[] { exp, toMCWrapper.gConfigProps.cfName }); } } throw e; } catch (java.lang.Exception e) { com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "495", this); if (isTraceOn && tc.isDebugEnabled()) { Tr.debug(this, tc, "reassociateConnectionHandle: Caught a Non resource exception from mc.associateConnection()"); } Tr.error(tc, "FAILED_CONNECTION_J2CA0021", new Object[] { e, toMCWrapper.gConfigProps.cfName }); /* * If the Resource Adapter throws an Exception and we are not in a * transaction and there are no other connections open on the ManagedConnection, * return the ManagedConnection to the pool before * rethrowing the exception. The ManagedConnection is probably OK - the exception * may only be a logon failure or similar so the MC shouldn't be 'lost'. * * If we are in a transaction, just throw the exception. Assume we will cleanup during * the aftercompletion call on the tran wrapper. */ if (uowCoord == null && toMCWrapper.getHandleCount() == 0) { try { toMCWrapper.releaseToPoolManager(); } catch (Exception exp) { // don't rethrow, already on exception path com.ibm.ws.ffdc.FFDCFilter.processException(exp, "com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle", "518", this); //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.error(tc, "FAILED_CONNECTION_RELEASE_J2CA0022", new Object[] { exp, toMCWrapper.gConfigProps.cfName }); } } ResourceException re = new ResourceException("reassociateConnectionHandle: caught Exception"); re.initCause(e); throw re; } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(this, tc, "reassociateConnectionHandle"); }
[ "private", "void", "reassociateConnectionHandle", "(", "Object", "connection", ",", "MCWrapper", "fromMCWrapper", ",", "MCWrapper", "toMCWrapper", ",", "UOWCoordinator", "uowCoord", ")", "throws", "ResourceException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "this", ",", "tc", ",", "\"reassociateConnectionHandle\"", ")", ";", "try", "{", "toMCWrapper", ".", "associateConnection", "(", "connection", ",", "fromMCWrapper", ")", ";", "}", "catch", "(", "ResourceException", "e", ")", "{", "/*\n * If the Resource Adapter throws a ResourceException and we are not in a\n * transaction and there are no other connections open on the ManagedConnection,\n * return the ManagedConnection to the pool before\n * rethrowing the exception. The ManagedConnection is probably OK - the exception\n * may only be a logon failure or similar so the MC shouldn't be 'lost'.\n *\n * If we are in a transaction, just throw the exception. Assume we will cleanup during\n * the aftercompletion call on the tran wrapper.\n */", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle\"", ",", "\"479\"", ",", "this", ")", ";", "if", "(", "uowCoord", "==", "null", "&&", "toMCWrapper", ".", "getHandleCount", "(", ")", "==", "0", ")", "{", "try", "{", "toMCWrapper", ".", "releaseToPoolManager", "(", ")", ";", "}", "catch", "(", "Exception", "exp", ")", "{", "// don't rethrow, already on exception path", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "exp", ",", "\"com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle\"", ",", "\"487\"", ",", "this", ")", ";", "//if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())", "Tr", ".", "error", "(", "tc", ",", "\"FAILED_CONNECTION_RELEASE_J2CA0022\"", ",", "new", "Object", "[", "]", "{", "exp", ",", "toMCWrapper", ".", "gConfigProps", ".", "cfName", "}", ")", ";", "}", "}", "throw", "e", ";", "}", "catch", "(", "java", ".", "lang", ".", "Exception", "e", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle\"", ",", "\"495\"", ",", "this", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "this", ",", "tc", ",", "\"reassociateConnectionHandle: Caught a Non resource exception from mc.associateConnection()\"", ")", ";", "}", "Tr", ".", "error", "(", "tc", ",", "\"FAILED_CONNECTION_J2CA0021\"", ",", "new", "Object", "[", "]", "{", "e", ",", "toMCWrapper", ".", "gConfigProps", ".", "cfName", "}", ")", ";", "/*\n * If the Resource Adapter throws an Exception and we are not in a\n * transaction and there are no other connections open on the ManagedConnection,\n * return the ManagedConnection to the pool before\n * rethrowing the exception. The ManagedConnection is probably OK - the exception\n * may only be a logon failure or similar so the MC shouldn't be 'lost'.\n *\n * If we are in a transaction, just throw the exception. Assume we will cleanup during\n * the aftercompletion call on the tran wrapper.\n */", "if", "(", "uowCoord", "==", "null", "&&", "toMCWrapper", ".", "getHandleCount", "(", ")", "==", "0", ")", "{", "try", "{", "toMCWrapper", ".", "releaseToPoolManager", "(", ")", ";", "}", "catch", "(", "Exception", "exp", ")", "{", "// don't rethrow, already on exception path", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "exp", ",", "\"com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle\"", ",", "\"518\"", ",", "this", ")", ";", "//if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())", "Tr", ".", "error", "(", "tc", ",", "\"FAILED_CONNECTION_RELEASE_J2CA0022\"", ",", "new", "Object", "[", "]", "{", "exp", ",", "toMCWrapper", ".", "gConfigProps", ".", "cfName", "}", ")", ";", "}", "}", "ResourceException", "re", "=", "new", "ResourceException", "(", "\"reassociateConnectionHandle: caught Exception\"", ")", ";", "re", ".", "initCause", "(", "e", ")", ";", "throw", "re", ";", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "this", ",", "tc", ",", "\"reassociateConnectionHandle\"", ")", ";", "}" ]
with a new MCWrapper. The fromMCWrapper can be null - needed for SmartHandle support.
[ "with", "a", "new", "MCWrapper", ".", "The", "fromMCWrapper", "can", "be", "null", "-", "needed", "for", "SmartHandle", "support", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1362-L1435
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java
ConnectionManager.inactiveConnectionClosed
@Override public void inactiveConnectionClosed( Object connection, ManagedConnectionFactory managedConnectionFactory) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) { Tr.entry(this, tc, "inactiveConnectionClosed"); } // Ensure all connection handle lists are cleared of this handle. // NOTE: The handle may exist in the EJB and Web container lists, but // these lists are currently inaccessible to J2C. if (isTraceOn && tc.isEntryEnabled()) { Tr.exit(this, tc, "inactiveConnectionClosed"); } }
java
@Override public void inactiveConnectionClosed( Object connection, ManagedConnectionFactory managedConnectionFactory) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) { Tr.entry(this, tc, "inactiveConnectionClosed"); } // Ensure all connection handle lists are cleared of this handle. // NOTE: The handle may exist in the EJB and Web container lists, but // these lists are currently inaccessible to J2C. if (isTraceOn && tc.isEntryEnabled()) { Tr.exit(this, tc, "inactiveConnectionClosed"); } }
[ "@", "Override", "public", "void", "inactiveConnectionClosed", "(", "Object", "connection", ",", "ManagedConnectionFactory", "managedConnectionFactory", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "this", ",", "tc", ",", "\"inactiveConnectionClosed\"", ")", ";", "}", "// Ensure all connection handle lists are cleared of this handle.", "// NOTE: The handle may exist in the EJB and Web container lists, but", "// these lists are currently inaccessible to J2C.", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "this", ",", "tc", ",", "\"inactiveConnectionClosed\"", ")", ";", "}", "}" ]
This method is called by resource adapters that support lazy associable connections in order to notify the connection manager that it moved the a connection handle from the inactive state to closed. @see javax.resource.spi.LazyAssociableConnectionManager An inactive handle is disassociated from a managed conection within the connection manager. This method provides the association and enables the connection manager to perform any clean-up necessary to maintain the integrity of a managed connection and its pool when an inactive connection is closed. @param connection The connection handle that is now closed. @param managedConnectionFactory The factory that created the handle.
[ "This", "method", "is", "called", "by", "resource", "adapters", "that", "support", "lazy", "associable", "connections", "in", "order", "to", "notify", "the", "connection", "manager", "that", "it", "moved", "the", "a", "connection", "handle", "from", "the", "inactive", "state", "to", "closed", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1453-L1469
train