code
stringlengths
73
34.1k
label
stringclasses
1 value
private static final String toUTF8String(byte[] b) { String ns = null; try { ns = new String(b, "UTF8"); } catch (UnsupportedEncodingException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Error converting to string; " + e); } } return ns; }
java
private static final String toSimpleString(byte[] b) { StringBuilder sb = new StringBuilder(); for (int i = 0, len = b.length; i < len; i++) { sb.append((char) (b[i] & 0xff)); } String str = sb.toString(); return str; }
java
private static final byte[] getSimpleBytes(String str) { StringBuilder sb = new StringBuilder(str); byte[] b = new byte[sb.length()]; for (int i = 0, len = sb.length(); i < len; i++) { b[i] = (byte) sb.charAt(i); } return b; }
java
public static ProtectedFunctionMapper getInstance() { ProtectedFunctionMapper funcMapper; if (System.getSecurityManager() != null) { funcMapper = (ProtectedFunctionMapper) AccessController.doPrivileged( new PrivilegedAction() { @Override public Object run() { return new ProtectedFunctionMapper(); } }); } else { funcMapper = new ProtectedFunctionMapper(); } funcMapper.fnmap = new java.util.HashMap(); return funcMapper; }
java
@Override public Method resolveFunction(String prefix, String localName) { return (Method) this.fnmap.get(prefix + ":" + localName); }
java
public void setItemType(JMFType elem) { if (elem == null) throw new NullPointerException("Repeated item cannot be null"); itemType = (JSType)elem; itemType.parent = this; itemType.siblingPosition = 0; }
java
protected void incrementActiveConns() { int count = this.activeConnections.incrementAndGet(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Increment active, current=" + count); } }
java
protected void decrementActiveConns() { int count = this.activeConnections.decrementAndGet(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Decrement active, current=" + count); } if (0 == count && this.quiescing) { signalNoConnections(); } }
java
@Trivial public void enactOpen(long openAt) { String methodName = "enactOpen"; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " On [ " + path + " ] at [ " + toRelSec(initialAt, openAt) + " (s) ]"); } if ( zipFileState == ZipFileState.OPEN ) { // OPEN -> OPEN openDuration += openAt - lastOpenAt; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; } else if ( zipFileState == ZipFileState.PENDING ) { // PENDING -> OPEN long lastPendDuration = openAt - lastPendAt; pendToOpenDuration += lastPendDuration; pendToOpenCount++; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; zipFileState = ZipFileState.OPEN; if ( ZIP_REAPER_COLLECT_TIMINGS ) { timing(" Pend Success [ " + toAbsSec(lastPendDuration) + " (s) ]"); } } else if ( zipFileState == ZipFileState.FULLY_CLOSED ) { // FULLY_CLOSED -> OPEN if ( firstOpenAt == -1L ) { firstOpenAt = openAt; } else { long lastFullCloseDuration = openAt - lastFullCloseAt; fullCloseToOpenDuration += lastFullCloseDuration; if ( ZIP_REAPER_COLLECT_TIMINGS ) { long lastPendDuration = ( (lastPendAt == -1L) ? 0 : (lastFullCloseAt - lastPendAt) ); timing(" Reopen; Pend [ " + toAbsSec(lastPendDuration) + " (s) ] " + " Close [ " + toAbsSec(lastFullCloseDuration) + " (s) ]"); } } fullCloseToOpenCount++; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; zipFileState = ZipFileState.OPEN; } else { throw unknownState(); } if ( ZIP_REAPER_COLLECT_TIMINGS ) { timing(" Open " + dualTiming(openAt, initialAt) + " " + openState()); } }
java
@Trivial protected ZipFile reacquireZipFile() throws IOException, ZipException { String methodName = "reacquireZipFile"; File rawZipFile = new File(path); long newZipLength = FileUtils.fileLength(rawZipFile); long newZipLastModified = FileUtils.fileLastModified(rawZipFile); boolean zipFileChanged = false; if ( newZipLength != zipLength ) { zipFileChanged = true; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update length from [ " + Long.valueOf(zipLength) + " ]" + // " to [ " + Long.valueOf(newZipLength) + " ]"); Tr.warning(tc, "reaper.unexpected.length.change", path, Long.valueOf(zipLength), Long.valueOf(newZipLength)); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Zip [ " + path + " ]:" + " Update length from [ " + Long.valueOf(zipLength) + " ]" + " to [ " + Long.valueOf(newZipLength) + " ]"); } } } if ( newZipLastModified != zipLastModified ) { zipFileChanged = true; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update last modified from [ " + Long.valueOf(zipLastModified) + " ]" + // " to [ " + Long.valueOf(newZipLastModified) + " ]"); Tr.warning(tc, "reaper.unexpected.lastmodified.change", path, Long.valueOf(zipLastModified), Long.valueOf(newZipLastModified)); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Zip [ " + path + " ]:" + " Update last modified from [ " + Long.valueOf(zipLastModified) + " ]" + " to [ " + Long.valueOf(newZipLastModified) + " ]"); } } } if ( zipFileChanged ) { if ( openCount > closeCount ) { // Tr.warning(tc, methodName + " Reopen [ " + path + " ]"); Tr.warning(tc, "reaper.reopen.active", path); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Reopen [ " + path + " ]"); } } @SuppressWarnings("unused") ZipFile oldZipFile = closeZipFile(); @SuppressWarnings("unused") ZipFile newZipFile = openZipFile(newZipLength, newZipLastModified); // throws IOException, ZipException } return zipFile; }
java
public static String getAttribute(XMLStreamReader reader, String localName) { int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { String name = reader.getAttributeLocalName(i); if (localName.equals(name)) { return reader.getAttributeValue(i); } } return null; }
java
public static <T> T createInstanceByElement(XMLStreamReader reader, Class<T> clazz, Set<String> attrNames) { if (reader == null || clazz == null || attrNames == null) return null; try { T instance = clazz.newInstance(); int count = reader.getAttributeCount(); int matchCount = attrNames.size(); for (int i = 0; i < count && matchCount > 0; ++i) { String name = reader.getAttributeLocalName(i); String value = reader.getAttributeValue(i); if (attrNames.contains(name)) { Field field = clazz.getDeclaredField(name); field.setAccessible(true); field.set(instance, value); matchCount--; } } return instance; } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (SecurityException e) { throw new RuntimeException(e); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } }
java
public void removeEjbBindings() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "removeEjbBindings called"); // Just loop through the values, not the keys, as the simple-binding-name // key may have a # in front of it when the bean was not simple, and that // won't match what is in the ServerContextBindingMap. d457053.1 for (String bindingName : ivEjbContextBindingMap.values()) { removeFromServerContextBindingMap(bindingName, true); } ivEjbContextBindingMap.clear(); }
java
public boolean isUniqueShortDefaultBinding(String interfaceName) { // If there were no explicit bindings, and only one implicit // binding, then it is considered uniquie. d457053.1 BindingData bdata = ivServerContextBindingMap.get(interfaceName); if (bdata != null && bdata.ivExplicitBean == null && bdata.ivImplicitBeans != null && bdata.ivImplicitBeans.size() == 1) { return true; } return false; }
java
public void removeShortDefaultBindings() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "removeShortDefaultBindings called"); for (String bindingName : ivEjbContextShortDefaultJndiNames) { removeFromServerContextBindingMap(bindingName, false); } ivEjbContextShortDefaultJndiNames.clear(); }
java
private void addToServerContextBindingMap(String interfaceName, String bindingName) throws NameAlreadyBoundException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "addToServerContextBindingMap : " + interfaceName + ", binding : " + bindingName); BindingData bdata = ivServerContextBindingMap.get(bindingName); if (bdata == null) { bdata = new BindingData(); ivServerContextBindingMap.put(bindingName, bdata); } if (bdata.ivExplicitBean == null) { bdata.ivExplicitBean = ivHomeRecord.j2eeName; bdata.ivExplicitInterface = interfaceName; if (bdata.ivImplicitBeans != null && bdata.ivImplicitBeans.size() > 1) { ivEjbContextAmbiguousMap.remove(interfaceName); } } else { J2EEName j2eeName = ivHomeRecord.j2eeName; if (bdata.ivExplicitBean.equals(j2eeName)) { Tr.error(tc, "NAME_ALREADY_BOUND_FOR_SAME_EJB_CNTR0173E", new Object[] { interfaceName, j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication(), bindingName, bdata.ivExplicitInterface }); // d479669 String message = "The " + interfaceName + " interface of the " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application " + "cannot be bound to the " + bindingName + " name location. " + "The " + bdata.ivExplicitInterface + " interface of the " + "same bean has already been bound to the " + bindingName + " name location."; throw new NameAlreadyBoundException(message); } else { Tr.error(tc, "NAME_ALREADY_BOUND_FOR_EJB_CNTR0172E", new Object[] { interfaceName, j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication(), bindingName, bdata.ivExplicitInterface, bdata.ivExplicitBean.getComponent(), bdata.ivExplicitBean.getModule(), bdata.ivExplicitBean.getApplication() }); // d479669 String message = "The " + interfaceName + " interface of the " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application " + "cannot be bound to the " + bindingName + " name location. " + "The " + bdata.ivExplicitInterface + " interface of the " + bdata.ivExplicitBean.getComponent() + " bean in the " + bdata.ivExplicitBean.getModule() + " module of the " + bdata.ivExplicitBean.getApplication() + " application " + "has already been bound to the " + bindingName + " name location."; throw new NameAlreadyBoundException(message); } } }
java
public static BindingsHelper getLocalHelper(HomeRecord homeRecord) { if (homeRecord.ivLocalBindingsHelper == null) { homeRecord.ivLocalBindingsHelper = new BindingsHelper(homeRecord, cvAllLocalBindings, null); } return homeRecord.ivLocalBindingsHelper; }
java
public static BindingsHelper getRemoteHelper(HomeRecord homeRecord) { if (homeRecord.ivRemoteBindingsHelper == null) { homeRecord.ivRemoteBindingsHelper = new BindingsHelper(homeRecord, cvAllRemoteBindings, "ejb/"); } return homeRecord.ivRemoteBindingsHelper; }
java
public synchronized void stop() { if (timer != null) { timer.keepRunning = false; timer.interrupt(); timer = null; } // Remove this manager from the space alert list LogRepositorySpaceAlert.getInstance().removeRepositoryInfo(this); }
java
protected static long calculateFileSplit(long repositorySize) { if (repositorySize <= 0) { return MAX_LOG_FILE_SIZE; } if (repositorySize < MIN_REPOSITORY_SIZE) { throw new IllegalArgumentException("Specified repository size is too small"); } long result = repositorySize / SPLIT_RATIO; if (result < MIN_LOG_FILE_SIZE) { result = MIN_LOG_FILE_SIZE; } else if (result > MAX_LOG_FILE_SIZE) { result = MAX_LOG_FILE_SIZE; } return result; }
java
private void initFileList(boolean force) { if (totalSize < 0 || force) { fileList.clear(); parentFilesMap.clear(); totalSize = 0L; File[] files = listRepositoryFiles(); if (files.length > 0) { Arrays.sort(files, fileComparator); for (File file: files) { long size = AccessHelper.getFileLength(file); // Intentional here to NOT add these files to activeFilesMap since they are legacy fileList.add(new FileDetails(file, getLogFileTimestamp(file), size, null)); totalSize += size; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "initFileList", "add: "+file.getPath()+" sz: "+size+ " listSz: "+fileList.size()+" new totalSz: "+totalSize); } incrementFileCount(file); } debugListLL("fileListPrePop") ; } deleteEmptyRepositoryDirs(); if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()){ Iterator<File> parentKeys = parentFilesMap.keySet().iterator() ; while (parentKeys.hasNext()) { File parentNameKey = parentKeys.next() ; Integer fileCount = parentFilesMap.get(parentNameKey) ; debugLogger.logp(Level.FINE, thisClass, "initFileList", " Directory: "+parentNameKey+" file count: "+ fileCount) ; } } } }
java
protected void deleteEmptyRepositoryDirs() { File[] directories = listRepositoryDirs(); //determine if the server/controller instance directory is empty for(int i = 0; i < directories.length; i++){ // This is a directory we should not delete boolean currentDir = ivSubDirectory != null && ivSubDirectory.compareTo(directories[i])==0; //if a server instance directory does not have a key in parentFilesMap, then it does not have any files if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Instance directory name (controller): " + directories[i].getAbsolutePath()); //now look for empty servant directories File[] childFiles = AccessHelper.listFiles(directories[i], subprocFilter) ; for (File curFile : childFiles) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Servant directory name: " + curFile.getAbsolutePath()); if (!currentDir && !parentFilesMap.containsKey(curFile)) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Found an empty servant directory: " + curFile); deleteDirectory(curFile); } else { incrementFileCount(curFile); } } //delete directory if empty if (!currentDir && !parentFilesMap.containsKey(directories[i])) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "listRepositoryFiles", "Found an empty directory: " + directories[i]); deleteDirectory(directories[i]); } } }
java
protected void deleteDirectory(File directoryName){ if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "empty directory "+((directoryName == null) ? "None": directoryName.getPath())); } if (AccessHelper.deleteFile(directoryName)) { // If directory is empty, delete if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "delete "+directoryName.getName()); } } else { // Else the directory is not empty, and deletion fails if (isDebugEnabled()) { debugLogger.logp(Level.WARNING, thisClass, "deleteDirectory", "Failed to delete directory "+directoryName.getPath()); } } }
java
private boolean purgeOldFiles(long total) { boolean result = false; // Should delete some files. if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldFiles", "total: "+total+" listSz: "+fileList.size()); } while(total > 0 && fileList.size() > 1) { FileDetails details = purgeOldestFile(); if (details != null) { if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldFiles", "Purged: "+details.file.getPath()+" sz: "+details.size); } total -= details.size; result = true; } } return result; }
java
private FileDetails purgeOldestFile() { debugListLL("prepurgeOldestFile") ; debugListHM("prepurgeOldestFile") ; FileDetails returnFD = getOldestInactive() ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "oldestInactive: "+((returnFD == null) ? "None": returnFD.file.getPath())); } if (returnFD == null) return null ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "fileList size before remove: "+fileList.size()) ; } if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "fileList size after remove: "+fileList.size()) ; } if (AccessHelper.deleteFile(returnFD.file)) { fileList.remove(returnFD) ; totalSize -= returnFD.size; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "delete: "+returnFD.file.getName()); } decrementFileCount(returnFD.file); notifyOfFileAction(LogEventListener.EVENTTYPEDELETE) ; // F004324 } else { // Assume the list is out of sync. if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "Failed to delete file: "+returnFD.file.getPath()); } initFileList(true); returnFD = null; } debugListLL("postpurgeOldestFile") ; return returnFD; }
java
public synchronized String addNewFileFromSubProcess(long spTimeStamp, String spPid, String spLabel) { // TODO: It is theoretically possible that subProcess already created one of these (although it won't happen in our scenario. // Consider either pulling actual pid from the files on initFileList or looking for the file here before adding it. If found, // adjust the pid to this pid. checkSpaceConstrain(maxLogFileSize) ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Tstamp: "+spTimeStamp+ " pid: "+spPid+" lbl: "+spLabel+" Max: "+maxLogFileSize); } if (ivSubDirectory == null) getControllingProcessDirectory(spTimeStamp, svPid) ; // Note: passing, pid of this region, not sending child region if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Got ivSubDir: "+ivSubDirectory.getPath()); } File servantDirectory = new File(ivSubDirectory, getLogDirectoryName(-1, spPid, spLabel)) ; File servantFile = getLogFile(servantDirectory, spTimeStamp) ; FileDetails thisFile = new FileDetails(servantFile, spTimeStamp, maxLogFileSize, spPid) ; synchronized(fileList) { initFileList(false) ; fileList.add(thisFile) ; // Not active as new one was created incrementFileCount(servantFile); synchronized(activeFilesMap) { // In this block so that fileList always locked first activeFilesMap.put(spPid, thisFile) ; } } totalSize += maxLogFileSize ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Added file: "+servantFile.getPath()+" sz:"+maxLogFileSize+" tstmp: "+spTimeStamp) ; debugListLL("postAddFromSP") ; debugListHM("postAddFromSP") ; } return servantFile.getPath() ; }
java
public void inactivateSubProcess(String spPid) { synchronized (fileList) { // always lock fileList first to avoid deadlock synchronized(activeFilesMap) { // Right into sync block because 99% case is that map contains pid activeFilesMap.remove(spPid) ; } } if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "inactivateSubProcess", "Inactivated pid: "+spPid) ; } }
java
protected int getContentLength(boolean update) { if (update){ contentLength = (int) this.getFileSize(update); return contentLength; } else { if (contentLength==-1){ contentLength = (int) this.getFileSize(update); return contentLength; } else { return contentLength; } } }
java
public void logError(String moduleName, String beanName, String methodName) { Tr.error(tc, ivError.getMessageId(), new Object[] { beanName, moduleName, methodName, ivField }); }
java
protected void restore(ObjectInputStream ois, int dataVersion) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "restore", new Object[] { dataVersion}); checkPersistentVersionId(dataVersion); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "restore"); }
java
synchronized void captureCheckpointManagedObjects() { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "captureCheckpointManagedObjectsremove" ); // Now that we are synchronized check that we have not captured the checkpoint sets already. if (checkpointManagedObjectsToWrite == null) { // Take the tokens to write first, if we miss a delete we will catch it next time. // The managedObjectsToWrite and tokensToDelete sets are volatile so users of the store will move to them // promptly. checkpointManagedObjectsToWrite = managedObjectsToWrite; managedObjectsToWrite = new ConcurrentHashMap(concurrency); checkpointTokensToDelete = tokensToDelete; tokensToDelete = new ConcurrentHashMap(concurrency); } if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "captureCheckpointManagedObjects"); }
java
private void write(ManagedObject managedObject) throws ObjectManagerException { final String methodName = "write"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { managedObject }); // Pick up and write the latest serialized bytes. ObjectManagerByteArrayOutputStream serializedBytes = null; if (usesSerializedForm) { // Pick up and write the latest serialized bytes. // It is possible that several threads requested a write one after the // other each getting the request added to a different managedObjetsToWrite table, // however the first of these through here will clear serializedBytes. // It is also possible that the transaction state of the managed object // was restored from a checkpoint, in which case the serialized object // may already be in the ObjectStore, and the serializedBytes will again be null. // Is the Object deleted? It may have got deleted after we release the // synchronize lock when we // captured the tokensToWrite hashtable but before we actually try to write it. if (managedObject.state != ManagedObject.stateDeleted) serializedBytes = managedObject.freeLatestSerializedBytes(); } else { // Not logged so use the current serialized bytes, as long as its not part of a transaction. // If it is part of a transaction then the transaction will hold the ManagedObject in memory. // Not locked because this is only used by SAVE_ONLY_ON_SHUTDOWN stores at shutdown // when no appliaction threads are active. if (managedObject.state == ManagedObject.stateReady) serializedBytes = managedObject.getSerializedBytes(); } // if ( usesSerializedForm ). // It is possible that several threads requested a write one after the other each getting the request added // to a different tokensToWrite table, however the first of these through here will clear serializedBytes. if (serializedBytes != null) { // Already done by another thread? try { java.io.FileOutputStream storeFileOutputStream = new java.io.FileOutputStream(storeDirectoryName + java.io.File.separator + managedObject.owningToken.storedObjectIdentifier); storeFileOutputStream.write(serializedBytes.getBuffer(), 0, serializedBytes.getCount()); storeFileOutputStream.flush(); storeFileOutputStream.close(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:656:1.17"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { exception }); throw new PermanentIOException(this, exception); } // catch java.io.IOException. managedObjectsOnDisk.add(new Long(managedObject.owningToken.storedObjectIdentifier)); } // if (serializedBytes != null ). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
public void writeHeader() throws ObjectManagerException { final String methodName = "writeHeader"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); try { java.io.FileOutputStream headerOutputStream = new java.io.FileOutputStream(storeDirectoryName + java.io.File.separator + headerIdentifier); java.io.DataOutputStream dataOutputStream = new java.io.DataOutputStream(headerOutputStream); java.io.FileDescriptor fileDescriptor = headerOutputStream.getFD(); dataOutputStream.writeInt(version); dataOutputStream.writeLong(objectStoreIdentifier); dataOutputStream.writeLong(sequenceNumber); dataOutputStream.flush(); headerOutputStream.flush(); fileDescriptor.sync(); // Force buffered records to disk. headerOutputStream.close(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:706:1.17"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { exception }); throw new PermanentIOException(this, exception); } // catch java.io.IOException. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
public static RestRepositoryConnection createConnection(RestRepositoryConnectionProxy proxy) throws RepositoryBackendIOException { readRepoProperties(proxy); RestRepositoryConnection connection = new RestRepositoryConnection(repoProperties.getProperty(REPOSITORY_URL_PROP).trim()); connection.setProxy(proxy); if (repoProperties.containsKey(API_KEY_PROP)) { connection.setApiKey(repoProperties.getProperty(API_KEY_PROP).trim()); } if (repoProperties.containsKey(USERID_PROP)) { connection.setUserId(repoProperties.getProperty(USERID_PROP).trim()); } if (repoProperties.containsKey(PASSWORD_PROP)) { connection.setPassword(repoProperties.getProperty(PASSWORD_PROP).trim()); } if (repoProperties.containsKey(SOFTLAYER_USERID_PROP)) { connection.setSoftlayerUserId(repoProperties.getProperty(SOFTLAYER_USERID_PROP).trim()); } if (repoProperties.containsKey(SOFTLAYER_PASSWORD_PROP)) { connection.setSoftlayerPassword(repoProperties.getProperty(SOFTLAYER_PASSWORD_PROP).trim()); } if (repoProperties.containsKey(ATTACHMENT_BASIC_AUTH_USERID_PROP)) { connection.setAttachmentBasicAuthUserId(repoProperties.getProperty(ATTACHMENT_BASIC_AUTH_USERID_PROP).trim()); } if (repoProperties.containsKey(ATTACHMENT_BASIC_AUTH_PASSWORD_PROP)) { connection.setAttachmentBasicAuthPassword(repoProperties.getProperty(ATTACHMENT_BASIC_AUTH_PASSWORD_PROP).trim()); } return connection; }
java
public static boolean repositoryDescriptionFileExists(RestRepositoryConnectionProxy proxy) { boolean exists = false; try { URL propertiesFileURL = getPropertiesFileLocation(); // Are we accessing the properties file (from DHE) using a proxy ? if (proxy != null) { if (proxy.isHTTPorHTTPS()) { Proxy javaNetProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxy.getProxyURL().getHost(), proxy.getProxyURL().getPort())); URLConnection connection = propertiesFileURL.openConnection(javaNetProxy); InputStream is = connection.getInputStream(); exists = true; is.close(); if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).disconnect(); } } else { // The proxy is not an HTTP or HTTPS proxy we do not support this UnsupportedOperationException ue = new UnsupportedOperationException("Non-HTTP proxy not supported"); throw new IOException(ue); } } else { // not using a proxy InputStream is = propertiesFileURL.openStream(); exists = true; is.close(); } } catch (MalformedURLException e) { // ignore } catch (IOException e) { // ignore } return exists; }
java
private static void checkHttpResponseCodeValid(URLConnection connection) throws RepositoryHttpException, IOException { // if HTTP URL not File URL if (connection instanceof HttpURLConnection) { HttpURLConnection conn = (HttpURLConnection) connection; conn.setRequestMethod("GET"); int respCode = conn.getResponseCode(); if (respCode < 200 || respCode >= 300) { throw new RepositoryHttpException("HTTP connection returned error code " + respCode, respCode, null); } } }
java
public static boolean isZos() { String os = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty("os.name"); } }); return os != null && (os.equalsIgnoreCase("OS/390") || os.equalsIgnoreCase("z/OS")); }
java
private InputStream safeOpen(String file) { URL url = bundle.getEntry(file); if (url != null) { try { return url.openStream(); } catch (IOException e) { // if we get an IOException just return null for default page. } } return null; }
java
public static String parseTempPrefix(String destinationName) { //Temporary dests are of the form _Q/_T<Prefix>_<MEId><TempdestId> String prefix = null; if (destinationName != null && (destinationName .startsWith(SIMPConstants.TEMPORARY_PUBSUB_DESTINATION_PREFIX)) || destinationName.startsWith( SIMPConstants.TEMPORARY_QUEUE_DESTINATION_PREFIX)) { int index = destinationName.indexOf(SIMPConstants.SYSTEM_DESTINATION_SEPARATOR, 2); if (index > 1) { prefix = destinationName.substring(2, index); } } return prefix; }
java
public static void setGuaranteedDeliveryProperties(ControlMessage msg, SIBUuid8 sourceMEUuid, SIBUuid8 targetMEUuid, SIBUuid12 streamId, SIBUuid12 gatheringTargetDestUuid, SIBUuid12 targetDestUuid, ProtocolType protocolType, byte protocolVersion) { // Remote to local message properties msg.setGuaranteedSourceMessagingEngineUUID(sourceMEUuid); msg.setGuaranteedTargetMessagingEngineUUID(targetMEUuid); msg.setGuaranteedStreamUUID(streamId); msg.setGuaranteedGatheringTargetUUID(gatheringTargetDestUuid); msg.setGuaranteedTargetDestinationDefinitionUUID(targetDestUuid); if (protocolType != null) msg.setGuaranteedProtocolType(protocolType); msg.setGuaranteedProtocolVersion(protocolVersion); }
java
@Override // Don't log this call: Rely on 'intern(String, boolean)' to log the intern call and result. @Trivial public String intern(String value) { return intern(value, Util_InternMap.DO_FORCE); }
java
public boolean isChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isChanged"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isChanged", changed); return changed; }
java
public void setUnChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setUnChanged"); changed = false; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setUnChanged"); }
java
public void setChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setChanged"); changed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setChanged"); }
java
public Object put(String key, Object value) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "put", new Object[]{key, PasswordUtils.replaceValueIfKeyIsPassword(key,value)}); // If the value is null (which is allowed for a Map Message) we can't tell // quickly whether the item is already in the map as null, or whether it doesn't exist, // so we just assume it will cause a change. // For properties we will never get a value of null, and it is properties we are really concerned with. if ((!changed)&& (value != null)) { Object old = get(key); if (value.equals(old)) { // may as well call equals immediately, as it checks for == and we know value!=null if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", "unchanged"); return old; } else { changed = true; Object result = copyMap().put(key, value); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", PasswordUtils.replaceValueIfKeyIsPassword(key,result)); return result; } } else { changed = true; Object result = copyMap().put(key, value); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", PasswordUtils.replaceValueIfKeyIsPassword(key,result)); return result; } }
java
public void addWebServiceFeatureInfo(String seiName, WebServiceFeatureInfo featureInfo) { PortComponentRefInfo portComponentRefInfo = seiNamePortComponentRefInfoMap.get(seiName); if (portComponentRefInfo == null) { portComponentRefInfo = new PortComponentRefInfo(seiName); seiNamePortComponentRefInfoMap.put(seiName, portComponentRefInfo); } portComponentRefInfo.addWebServiceFeatureInfo(featureInfo); }
java
@Trivial final String getName() { Map<String, String> execProps = getExecutionProperties(); String taskName = execProps == null ? null : execProps.get(ManagedTask.IDENTITY_NAME); return taskName == null ? task.toString() : taskName; }
java
public static WASConfiguration getDefaultWasConfiguration() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getDefaultWasConfiguration()"); WASConfiguration config = new WASConfiguration(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getDefaultWasConfiguration()", config); return(config); }
java
public void performRecovery(ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "performRecovery", "ObjectManagerState=" + objectManagerState); if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, "logicalUnitOfWork.identifier=" + logicalUnitOfWork.identifier + "(long)"); Transaction transactionForRecovery = objectManagerState.getTransaction(logicalUnitOfWork); transactionForRecovery.commit(false); // Do not re use this Transaction. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "performRecovery"); }
java
public void initialize(CacheConfig cc) { if (tc.isEntryEnabled()) Tr.entry(tc, "initialize"); cacheConfig = cc; if (null != cc){ try { if (tc.isDebugEnabled()) Tr.debug(tc, "Initializing CacheUnit " + uniqueServerNameFQ); nullRemoteServices.setCacheUnit(uniqueServerNameFQ, this); } catch (Exception ex) { //ex.printStackTrace(); com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.CacheUnitImpl.initialize", "120", this); Tr.error(tc, "dynacache.configerror", ex.getMessage()); throw new IllegalStateException("Unexpected exception: " + ex.getMessage()); } } if (tc.isEntryEnabled()) Tr.exit(tc, "initialize"); }
java
public void batchUpdate(String cacheName, HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents) { if (tc.isEntryEnabled()) Tr.entry(tc, "batchUpdate():"+cacheName); invalidationAuditDaemon.registerInvalidations(cacheName, invalidateIdEvents.values().iterator()); invalidationAuditDaemon.registerInvalidations(cacheName, invalidateTemplateEvents.values().iterator()); pushEntryEvents = invalidationAuditDaemon.filterEntryList(cacheName, pushEntryEvents); DCache cache = ServerCache.getCache(cacheName); if (cache!=null) { cache.batchUpdate(invalidateIdEvents, invalidateTemplateEvents, pushEntryEvents); if (cache.getCacheConfig().isEnableServletSupport() == true) { if (servletCacheUnit != null) { servletCacheUnit.invalidateExternalCaches(invalidateIdEvents, invalidateTemplateEvents); } else { if (tc.isDebugEnabled()) Tr.debug(tc, "batchUpdate() cannot do invalidateExternalCaches because servletCacheUnit=NULL."); } } } if (tc.isEntryEnabled()) Tr.exit(tc, "batchUpdate()"); }
java
public CacheEntry getEntry(String cacheName, Object id, boolean ignoreCounting ) { if (tc.isEntryEnabled()) Tr.entry(tc, "getEntry: {0}", id); DCache cache = ServerCache.getCache(cacheName); CacheEntry cacheEntry = null; if ( cache != null ) { cacheEntry = (CacheEntry) cache.getEntry(id, CachePerf.REMOTE, ignoreCounting, DCacheBase.INCREMENT_REFF_COUNT); } if (tc.isEntryEnabled()) Tr.exit(tc, "getEntry: {0}", id); return cacheEntry; }
java
public void setEntry(String cacheName, CacheEntry cacheEntry) { if (tc.isEntryEnabled()) Tr.entry(tc, "setEntry: {0}", cacheEntry.id); cacheEntry = invalidationAuditDaemon.filterEntry(cacheName, cacheEntry); if (cacheEntry != null) { DCache cache = ServerCache.getCache(cacheName); cache.setEntry(cacheEntry,CachePerf.REMOTE); } if (tc.isEntryEnabled()) Tr.exit(tc, "setEntry: {0}", cacheEntry==null?"null":cacheEntry.id ); }
java
public void setExternalCacheFragment(ExternalInvalidation externalCacheFragment) { if (tc.isEntryEnabled()) Tr.entry(tc, "setExternalCacheFragment: {0}", externalCacheFragment.getUri()); externalCacheFragment = invalidationAuditDaemon.filterExternalCacheFragment(ServerCache.cache.getCacheName(), externalCacheFragment); if (externalCacheFragment != null) { batchUpdateDaemon.pushExternalCacheFragment(externalCacheFragment, ServerCache.cache); } if (tc.isEntryEnabled()) Tr.exit(tc, "setExternalCacheFragment: {0}", externalCacheFragment.getUri()); }
java
public void startServices(boolean startTLD) { synchronized (this.serviceMonitor) { //multiple threads can call this concurrently if (this.batchUpdateDaemon == null) { //---------------------------------------------- // Initialize BatchUpdateDaemon object //---------------------------------------------- batchUpdateDaemon = new BatchUpdateDaemon(cacheConfig.batchUpdateInterval); //---------------------------------------------- // Initialize InvalidationAuditDaemon object //---------------------------------------------- invalidationAuditDaemon = new InvalidationAuditDaemon(cacheConfig.timeHoldingInvalidations); //---------------------------------------------- // link invalidationAuditDaemon to BatchUpdateDaemon //---------------------------------------------- batchUpdateDaemon.setInvalidationAuditDaemon(invalidationAuditDaemon); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting BatchUpdateDaemon/invalidationAuditDaemon services. " + "These services should only start once for all cache instances. Settings are: " + " batchUpdateInterval=" + cacheConfig.batchUpdateInterval + " timeHoldingInvalidations=" + cacheConfig.timeHoldingInvalidations); } //---------------------------------------------- // start services //---------------------------------------------- batchUpdateDaemon.start(); invalidationAuditDaemon.start(); } if (startTLD && this.timeLimitDaemon == null) { //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- // lruToDiskTriggerTime is set to the default (5 sec) under the following conditions // (1) less than 1 msec // (2) larger than timeGranularityInSeconds int lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME; if (cacheConfig.lruToDiskTriggerTime > cacheConfig.timeGranularityInSeconds * 1000 || cacheConfig.lruToDiskTriggerTime < CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME) { Tr.warning(tc, "DYNA0069W", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime), "lruToDiskTriggerTime", cacheConfig.cacheName, new Integer(CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME), new Integer(cacheConfig.timeGranularityInSeconds * 1000), new Integer(CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME)}); cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; } else { lruToDiskTriggerTime = cacheConfig.lruToDiskTriggerTime; } if (lruToDiskTriggerTime == CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME && (cacheConfig.lruToDiskTriggerPercent > CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_PERCENT || cacheConfig.memoryCacheSizeInMB != CacheConfig.DEFAULT_DISABLE_CACHE_SIZE_MB)) { lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME_FOR_TRIMCACHE; cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; Tr.audit(tc, "DYNA1069I", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime)}); } //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- timeLimitDaemon = new TimeLimitDaemon(cacheConfig.timeGranularityInSeconds, lruToDiskTriggerTime); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting TimeLimitDaemon service. " + "This service should only start once for all cache instances. Settings are: " + " timeGranularityInSeconds=" + cacheConfig.timeGranularityInSeconds + " lruToDiskTriggerTime=" + cacheConfig.lruToDiskTriggerTime); } //---------------------------------------------- // start service //---------------------------------------------- timeLimitDaemon.start(); } } }
java
public void addAlias(String cacheName, Object id, Object[] aliasArray) { if (id != null && aliasArray != null) { DCache cache = ServerCache.getCache(cacheName); if (cache != null) { try { cache.addAlias(id, aliasArray, false, false); } catch (IllegalArgumentException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "Adding alias for cache id " + id + " failure: " + e.getMessage()); } } } } }
java
public void removeAlias(String cacheName, Object alias) { if (alias != null) { DCache cache = ServerCache.getCache(cacheName); if (cache != null) { try { cache.removeAlias(alias, false, false); } catch (IllegalArgumentException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "Removing alias " + alias + " failure: " + e.getMessage()); } } } } }
java
public CommandCache getCommandCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (servletCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Servlet cache service has not been started."); } return servletCacheUnit.getCommandCache(cacheName); }
java
public JSPCache getJSPCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (servletCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Servlet cache service has not been started."); } return servletCacheUnit.getJSPCache(cacheName); }
java
public Object createObjectCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (objectCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Object cache service has not been started."); } return objectCacheUnit.createObjectCache(cacheName); }
java
public EventSource createEventSource(boolean createAsyncEventSource, String cacheName) throws DynamicCacheServiceNotStarted { if (objectCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Object cache service has not been started."); } return objectCacheUnit.createEventSource(createAsyncEventSource, cacheName); }
java
public DERObject toASN1Object() { ASN1EncodableVector dev = new ASN1EncodableVector(); dev.add(policyQualifierId); dev.add(qualifier); return new DERSequence(dev); }
java
public void sendAckExpectedMessage(long ackExpStamp, int priority, Reliability reliability, SIBUuid12 stream) // not used for ptp throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendAckExpectedMessage", new Object[] { new Long(ackExpStamp), new Integer(priority), reliability }); if( routingMEUuid != null ) { ControlAckExpected ackexpMsg; try { ackexpMsg = cmf.createNewControlAckExpected(); } catch (Exception e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendAckExpectedMessage", "1:733:1.241", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendAckExpectedMessage", e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:744:1.241", e }); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:752:1.241", e }, null), e); } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils.setGuaranteedDeliveryProperties(ackexpMsg, messageProcessor.getMessagingEngineUuid(), targetMEUuid, stream, null, destinationHandler.getUuid(), ProtocolType.UNICASTINPUT, GDConfig.PROTOCOL_VERSION); ackexpMsg.setTick(ackExpStamp); ackexpMsg.setPriority(priority); ackexpMsg.setReliability(reliability); // SIB0105 // Update the health state of this stream SourceStream sourceStream = (SourceStream)sourceStreamManager .getStreamSet() .getStream(priority, reliability); if (sourceStream != null) { sourceStream.setLatestAckExpected(ackExpStamp); sourceStream.getControlAdapter() .getHealthState().updateHealth(HealthStateListener.ACK_EXPECTED_STATE, HealthState.AMBER); } // If the destination in a Link add Link specific properties to message if( isLink ) { ackexpMsg = (ControlAckExpected)addLinkProps(ackexpMsg); } // If the destination is system or temporary then the // routingDestination into th message if( this.isSystemOrTemp ) { ackexpMsg.setRoutingDestination(routingDestination); } // Send ackExpected message to destination // Using MPIO mpio.sendToMe(routingMEUuid, priority, ackexpMsg ); } else { if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc,"Unable to send AckExpected as Link not started"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendAckExpectedMessage"); }
java
public void sendSilenceMessage( long startStamp, long endStamp, long completedPrefix, boolean requestedOnly, int priority, Reliability reliability, SIBUuid12 stream) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendSilenceMessage"); ControlSilence sMsg; try { // Create new Silence message sMsg = cmf.createNewControlSilence(); } catch (Exception e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendSilenceMessage", "1:849:1.241", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:856:1.241", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendSilenceMessage", e); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:867:1.241", e }, null), e); } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils.setGuaranteedDeliveryProperties(sMsg, messageProcessor.getMessagingEngineUuid(), targetMEUuid, stream, null, destinationHandler.getUuid(), ProtocolType.UNICASTINPUT, GDConfig.PROTOCOL_VERSION); sMsg.setStartTick(startStamp); sMsg.setEndTick(endStamp); sMsg.setPriority(priority); sMsg.setReliability(reliability); sMsg.setCompletedPrefix(completedPrefix); // If the destination in a Link add Link specific properties to message if( isLink ) { sMsg = (ControlSilence)addLinkProps(sMsg); } // If the destination is system or temporary then the // routingDestination into th message if( this.isSystemOrTemp ) { sMsg.setRoutingDestination(routingDestination); } // Send message to destination // Using MPIO // If requestedOnly then this is a response to a Nack so resend at priority+1 if( requestedOnly ) mpio.sendToMe(routingMEUuid, priority+1, sMsg); else mpio.sendToMe(routingMEUuid, priority, sMsg); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendSilenceMessage"); }
java
protected void handleRollback(LocalTransaction transaction) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleRollback", transaction); // Roll back the transaction if we created it. if (transaction != null) { try { transaction.rollback(); } catch (SIException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.handleRollback", "1:1644:1.241", this); SibTr.exception(tc, e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleRollback"); }
java
public void updateTargetCellule(SIBUuid8 targetMEUuid) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateTargetCellule", targetMEUuid); this.targetMEUuid = targetMEUuid; sourceStreamManager.updateTargetCellule(targetMEUuid); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateTargetCellule"); }
java
public void updateRoutingCellule( SIBUuid8 routingME ) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateRoutingCellule", routingME); this.routingMEUuid = routingME; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateRoutingCellule"); }
java
public void enqueueWork(AsyncUpdate unit) throws ClosedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "enqueueWork", unit); synchronized (this) { if (closed) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", "ClosedException"); throw new ClosedException(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Enqueueing update: " + unit); enqueuedUnits.add(unit); if (executing) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", "AsyncUpdateThread executing"); return; } // not executing enqueued updates if (enqueuedUnits.size() > batchThreshold) { executeSinceExpiry = true; try { startExecutingUpdates(); } catch (ClosedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", e); throw e; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork"); }
java
private void startExecutingUpdates() throws ClosedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "startExecutingUpdates"); // swap the enqueuedUnits and executingUnits. ArrayList temp = executingUnits; executingUnits = enqueuedUnits; enqueuedUnits = temp; enqueuedUnits.clear(); // enqueuedUnits is now ready to accept AsyncUpdates in enqueueWork() executing = true; try { LocalTransaction tran = tranManager.createLocalTransaction(false); ExecutionThread thread = new ExecutionThread(executingUnits, tran); mp.startNewSystemThread(thread); } catch (InterruptedException e) { // this object cannot recover from this exception since we don't know how much work the ExecutionThread // has done. should not occur! FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.AsyncUpdateThread.startExecutingUpdates", "1:222:1.28", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "startExecutingUpdates", e); closed = true; throw new ClosedException(e.getMessage()); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "startExecutingUpdates"); }
java
public void alarm(Object thandle) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "alarm", new Object[] {this, mp.getMessagingEngineUuid()}); synchronized (this) { if (!closed) { if ((executeSinceExpiry) || executing) { // has committed recently executeSinceExpiry = false; } else { // has not committed recently try { if (enqueuedUnits.size() > 0) startExecutingUpdates(); } catch (ClosedException e) { // No FFDC code needed // do nothing as error already logged by startExecutingUpdates } } } } // end synchronized (this) if (maxCommitInterval > 0) { mp.getAlarmManager().create(maxCommitInterval, this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "alarm"); }
java
public void waitTillAllUpdatesExecuted() throws InterruptedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "waitTillAllUpdatesExecuted"); synchronized (this) { while (enqueuedUnits.size() > 0 || executing) { try { this.wait(); } catch (InterruptedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "waitTillAllUpdatesExecuted", e); throw e; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "waitTillAllUpdatesExecuted"); }
java
public Throwable getRootCause() { Throwable root = getError(); while(true) { if(root instanceof ServletException) { ServletException se = (ServletException)_error; Throwable seRoot = se.getRootCause(); if(seRoot == null) { return root; } else if(seRoot.equals(root)) {//prevent possible recursion return root; } else { root = seRoot; } } else { return root; } } }
java
protected void activate(ComponentContext context) { securityServiceRef.activate(context); unauthSubjectServiceRef.activate(context); authServiceRef.activate(context); credServiceRef.activate(context); }
java
protected void initialise(String logFileName, int logFileType, java.util.Map objectStoreLocations, ObjectManagerEventCallback[] callbacks) throws ObjectManagerException { final String methodName = "initialise"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { logFileName, new Integer(logFileType), objectStoreLocations, callbacks }); if (objectStoreLocations == null) objectStoreLocations = new java.util.HashMap(); // Repeat attempts to find or create an ObjectManagerState. for (;;) { // Look for existing ObjectManagerState. synchronized (objectManagerStates) { objectManagerState = (ObjectManagerState) objectManagerStates.get(logFileName); if (objectManagerState == null) { // None known, so make one. objectManagerState = createObjectManagerState(logFileName, logFileType, objectStoreLocations, callbacks); objectManagerStates.put(logFileName, objectManagerState); } } // synchronized (objectManagerStates). synchronized (objectManagerState) { if (objectManagerState.state == ObjectManagerState.stateColdStarted || objectManagerState.state == ObjectManagerState.stateWarmStarted) { // We are ready to go. break; } else { // Wait for the ObjectManager state to become usable or terminate. try { objectManagerState.wait(); // Let some other thread initialise the ObjectManager . } catch (InterruptedException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(cclass, methodName, exception, "1:260:1.28"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw new UnexpectedExceptionException(this, exception); } // catch (InterruptedException exception). } // if (objectManagerState.state... } // synchronized (objectManagerState) } // for (;;). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
protected ObjectManagerState createObjectManagerState(String logFileName, int logFileType, java.util.Map objectStoreLocations, ObjectManagerEventCallback[] callbacks) throws ObjectManagerException { return new ObjectManagerState(logFileName, this, logFileType, objectStoreLocations, callbacks); }
java
public final boolean warmStarted() { final String methodName = "warmStarted"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); boolean isWarmStarted = false; if (objectManagerState.state == ObjectManagerState.stateWarmStarted) isWarmStarted = true; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Boolean(isWarmStarted)); return isWarmStarted; }
java
public final void shutdown() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutdown" ); objectManagerState.shutdown(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdown" ); }
java
public final void shutdownFast() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutdownFast" ); if (!testInterfaces) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdownFast" , "via InterfaceDisabledException" ); throw new InterfaceDisabledException(this , "shutdownFast"); } // if (!testInterfaces). objectManagerState.shutdownFast(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdownFast" ); }
java
public final void waitForCheckpoint() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "waitForCheckpoint" ); if (!testInterfaces) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "waitForCheckpoint via InterfaceDisabledException" ); throw new InterfaceDisabledException(this , "waitForCheckpoint"); } // if (!testInterfaces). objectManagerState.waitForCheckpoint(true); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "waitForCheckpoint" ); }
java
public final Transaction getTransaction() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransaction" ); // If the log is full introduce a delay for a checkpoiunt before allowing the // application to proceed. objectManagerState.transactionPacing(); Transaction transaction = objectManagerState.getTransaction(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransaction" , "returns transaction=" + transaction + "(Transaction)" ); return transaction; }
java
public final Transaction getTransactionByXID(byte[] XID) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransactionByXID" , "XIDe=" + XID + "(byte[]" ); Transaction transaction = objectManagerState.getTransactionByXID(XID); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransactionByXID" , "returns transaction=" + transaction + "(Transaction)" ); return transaction; }
java
public final java.util.Iterator getTransactionIterator() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransactionIterator" ); java.util.Iterator transactionIterator = objectManagerState.getTransactionIterator(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransactionIterator" , "returns transactionIterator" + transactionIterator + "(java.util.Iterator)" ); return transactionIterator; }
java
public final ObjectStore getObjectStore(String objectStoreName) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getObjectStore" , "objectStoreName=" + objectStoreName + "(String)" ); ObjectStore objectStore = objectManagerState.getObjectStore(objectStoreName); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getObjectStore" , "returns objectStore=" + objectStore + "(ObjectStore)" ); return objectStore; }
java
public final java.util.Iterator getObjectStoreIterator() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getObjectStoreIterator" ); java.util.Iterator objectStoreIterator = objectManagerState.getObjectStoreIterator(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getObjectStoreIterator" , new Object[] { objectStoreIterator } ); return objectStoreIterator; }
java
public final Token getNamedObject(String name , Transaction transaction) throws ObjectManagerException { final String methodName = "getNamedObject"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , methodName , new Object[] { name, transaction } ); // Is the definitive tree assigned? if (objectManagerState.namedObjects == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , "via NoRestartableObjectStoresAvailableException" ); throw new NoRestartableObjectStoresAvailableException(this); } // if (objectManagerState.namedObjects == null). TreeMap namedObjectsTree = (TreeMap) objectManagerState.namedObjects.getManagedObject(); Token token = (Token) namedObjectsTree.get(name, transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , new Object[] { token } ); return token; }
java
public final Token removeNamedObject(String name , Transaction transaction) throws ObjectManagerException { final String methodName = "removeNamedObject"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , methodName , new Object[] { name, transaction } ); Token tokenOut = null; // For return. // See if there is a definitive namedObjdects tree. if (objectManagerState.namedObjects == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , "via NoRestartablebjectStoresAvailableException" ); throw new NoRestartableObjectStoresAvailableException(this); } // if (objectManagerState.namedObjects == null). // Loop over all of the ObjectStores. java.util.Iterator objectStoreIterator = objectManagerState.objectStores.values().iterator(); while (objectStoreIterator.hasNext()) { ObjectStore objectStore = (ObjectStore) objectStoreIterator.next(); // Don't bother with ObjectStores that can't be used for recovery. if (objectStore.getContainsRestartData()) { // Locate any existing copy. Token namedObjectsToken = new Token(objectStore, ObjectStore.namedObjectTreeIdentifier.longValue()); // Swap for the definitive Token, if there is one. namedObjectsToken = objectStore.like(namedObjectsToken); TreeMap namedObjectsTree = (TreeMap) namedObjectsToken.getManagedObject(); tokenOut = (Token) namedObjectsTree.remove(name, transaction); } // if (objectStore.getContainsRestartData()). } // While objectStoreIterator.hasNext(). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , new Object[] { tokenOut }); return tokenOut; }
java
public final void setTransactionsPerCheckpoint(long persistentTransactionsPerCheckpoint , long nonPersistentTransactionsPerCheckpoint , Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "setTransactionsPerCheckpoint" , new Object[] { new Long(persistentTransactionsPerCheckpoint) , new Long(nonPersistentTransactionsPerCheckpoint) , transaction } ); transaction.lock(objectManagerState); objectManagerState.persistentTransactionsPerCheckpoint = persistentTransactionsPerCheckpoint; objectManagerState.nonPersistentTransactionsPerCheckpoint = nonPersistentTransactionsPerCheckpoint; // saveClonedState does not update the defaultStore. transaction.replace(objectManagerState); // Save the updates in the restartable ObjectStores. objectManagerState.saveClonedState(transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setTransactionsPerCheckpoint" ); }
java
public final void setMaximumActiveTransactions(int maximumActiveTransactions , Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "setMaximumActiveTransactions" , new Object[] { new Integer(maximumActiveTransactions) , transaction } ); transaction.lock(objectManagerState); objectManagerState.maximumActiveTransactions = maximumActiveTransactions; // saveClonedState does not update the defaultStore. transaction.replace(objectManagerState); // Save the updates in the restartable ObjectStores. objectManagerState.saveClonedState(transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setMaximumActiveTransactions" ); }
java
public java.util.Map captureStatistics(String name ) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "captureStatistics", new Object[] { name }); java.util.Map statistics = new java.util.HashMap(); // To be returned. synchronized (objectManagerState) { if (!(objectManagerState.state == ObjectManagerState.stateColdStarted) && !(objectManagerState.state == ObjectManagerState.stateWarmStarted)) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "addEntry" , new Object[] { new Integer(objectManagerState.state), ObjectManagerState.stateNames[objectManagerState.state] } ); throw new InvalidStateException(this, objectManagerState.state, ObjectManagerState.stateNames[objectManagerState.state]); } if (name.equals("*")) { statistics.putAll(objectManagerState.logOutput.captureStatistics()); statistics.putAll(captureStatistics()); } else if (name.equals("LogOutput")) { statistics.putAll(objectManagerState.logOutput.captureStatistics()); } else if (name.equals("ObjectManager")) { statistics.putAll(captureStatistics()); } else { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "captureStatistics", new Object[] { name }); throw new StatisticsNameNotFoundException(this, name); } // if (name.equals... } // synchronized (objectManagerState). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "captureStatistics" , statistics ); return statistics; }
java
public void registerEventCallback(ObjectManagerEventCallback callback) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "registerEventCallback", callback); objectManagerState.registerEventCallback(callback); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "registerEventCallback"); }
java
public String getLogProviderDefinition(BootstrapConfig bootProps) { String logProvider = bootProps.get(BOOTPROP_LOG_PROVIDER); if (logProvider == null) logProvider = defaults.getProperty(MANIFEST_LOG_PROVIDER); if (logProvider != null) bootProps.put(BOOTPROP_LOG_PROVIDER, logProvider); return logProvider; }
java
public String getOSExtensionDefinition(BootstrapConfig bootProps) { String osExtension = bootProps.get(BOOTPROP_OS_EXTENSIONS); if (osExtension == null) { String normalizedName = getNormalizedOperatingSystemName(bootProps.get("os.name")); osExtension = defaults.getProperty(MANIFEST_OS_EXTENSION + normalizedName); } if (osExtension != null) bootProps.put(BOOTPROP_OS_EXTENSIONS, osExtension); return osExtension; }
java
private TypeContainer getProperty(String propName) { TypeContainer container = cache.get(propName); if (container == null) { container = new TypeContainer(propName, config, version); TypeContainer existing = cache.putIfAbsent(propName, container); if (existing != null) { return existing; } } return container; }
java
private void publishStartedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_STARTED, correlationId); } }
java
private void publishEndedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_ENDED, correlationId); } }
java
public void setHeaders(Map<String, String> map) { headers = new MetadataMap<String, String>(); for (Map.Entry<String, String> entry : map.entrySet()) { String[] values = entry.getValue().split(","); for (String v : values) { if (v.length() != 0) { headers.add(entry.getKey(), v); } } } }
java
public WebClient createWebClient() { String serviceAddress = getAddress(); int queryIndex = serviceAddress != null ? serviceAddress.lastIndexOf('?') : -1; if (queryIndex != -1) { serviceAddress = serviceAddress.substring(0, queryIndex); } Service service = new JAXRSServiceImpl(serviceAddress, getServiceName()); getServiceFactory().setService(service); try { Endpoint ep = createEndpoint(); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE, ep); ClientState actualState = getActualState(); WebClient client = actualState == null ? new WebClient(getAddress()) : new WebClient(actualState); initClient(client, ep, actualState == null); notifyLifecycleManager(client); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.CLIENT_CREATED, client, ep); return client; } catch (Exception ex) { LOG.severe(ex.getClass().getName() + " : " + ex.getLocalizedMessage()); throw new RuntimeException(ex); } }
java
public <T> T create(Class<T> cls, Object... varValues) { return cls.cast(createWithValues(varValues)); }
java
public static final Object deserialize(byte[] bytes) throws Exception { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(tc, "deserialize"); Object o; try { ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInputStream oin = new ObjectInputStream(bis); o = oin.readObject(); oin.close(); } catch (IOException e) { FFDCFilter.processException(e, ConnectorService.class.getName(), "151"); if (trace && tc.isEntryEnabled()) Tr.exit(tc, "deserialize", new Object[] { toString(bytes), e }); throw e; } if (trace && tc.isEntryEnabled()) Tr.exit(tc, "deserialize", o == null ? null : o.getClass()); return o; }
java
public static final String getMessage(String key, Object... args) { return NLS.getFormattedMessage(key, args, key); }
java