code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
protected void run(String war, String servlet, String testMethod) throws Exception {
FATServletClient.runTest(getServer(), war + "/" + servlet, testMethod);
} | java |
private Context getURLContext(String name) throws NamingException {
int schemeIndex = name.indexOf(":");
if (schemeIndex != -1) {
String scheme = name.substring(0, schemeIndex);
return NamingManager.getURLContext(scheme, env);
}
return null;
} | java |
private static int indexOf(Object o, Object[] elements,
int index, int fence) {
if (o == null) {
for (int i = index; i < fence; i++)
if (elements[i] == null)
return i;
} else {
for (int i = index; i < fence; i++)
... | java |
private static int lastIndexOf(Object o, Object[] elements, int index) {
if (o == null) {
for (int i = index; i >= 0; i--)
if (elements[i] == null)
return i;
} else {
for (int i = index; i >= 0; i--)
if (o.equals(elements[i]))
... | java |
public boolean addIfAbsent(E e) {
final ReentrantLock lock = this.lock;
lock.lock();
try {
// Copy while checking if already present.
// This wins in the most common case where it is not present
Object[] elements = getArray();
int len = elements.le... | java |
@Override
public boolean removeAll(Collection<?> c) {
final ReentrantLock lock = this.lock;
lock.lock();
try {
Object[] elements = getArray();
int len = elements.length;
if (len != 0) {
// temp array holds those elements we know we want to ... | java |
public int addAllAbsent(Collection<? extends E> c) {
Object[] cs = c.toArray();
if (cs.length == 0)
return 0;
Object[] uniq = new Object[cs.length];
final ReentrantLock lock = this.lock;
lock.lock();
try {
Object[] elements = getArray();
... | java |
@Override
public boolean addAll(Collection<? extends E> c) {
Object[] cs = c.toArray();
if (cs.length == 0)
return false;
final ReentrantLock lock = this.lock;
lock.lock();
try {
Object[] elements = getArray();
int len = elements.length;
... | java |
public Runnable discriminate(HttpInboundConnectionExtended inboundConnection) {
String requestUri = inboundConnection.getRequest().getURI();
Runnable requestHandler = null;
// Find the container that can handle this URI.
// The first to return a non-null wins
for (HttpContaine... | java |
public static void generateLocalVariables(JavaCodeWriter out, Element jspElement, String pageContextVar) throws JspCoreException {
if (hasUseBean(jspElement)) {
out.println("HttpSession session = "+pageContextVar+".getSession();");
out.println("ServletContext application = "+pageContextV... | java |
public static String interpreterCall(
boolean isTagFile,
String expression,
Class expectedType,
String fnmapvar,
boolean XmlEscape,
String pageContextVar) { //PK65013
return JSPExtensionFactory.getGeneratorUtilsExtFactory().getGeneratorUtilsExt().interpreterCall... | java |
public static String attributeValue(
String valueIn,
boolean encode,
Class expectedType,
JspConfiguration jspConfig,
boolean isTagFile,
String pageContextVar) {
String value = valueIn;
value = value.replaceAll(">", ">");
value = value.replaceAll... | java |
Object[] getObjects(ExtendedLogEntry logEntry, boolean translatedMsg) {
ArrayList<Object> list = new ArrayList<Object>(5);
if (translatedMsg && logEntry.getMessage() != null) {
list.add(logEntry.getMessage());
}
if (!translatedMsg) {
String loggerName = logEntry... | java |
private void addToLoggedOutTokenCache(String tokenString) {
String tokenValue = "userName";
LoggedOutTokenCacheImpl.getInstance().addTokenToDistributedMap(tokenString, tokenValue);
} | java |
private void removeEntryFromAuthCache(HttpServletRequest req, HttpServletResponse res, WebAppSecurityConfig config) {
/*
* TODO: we need to optimize this method... if the authCacheService.remove() method
* return true for successfully removed the entry in the authentication cache, then we
... | java |
private void removeEntryFromAuthCacheForToken(HttpServletRequest req, HttpServletResponse res, WebAppSecurityConfig config) {
getAuthCacheService();
if (authCacheService == null) {
return;
}
Cookie[] cookies = req.getCookies();
if (cookies != null) {
Stri... | java |
private void removeEntryFromAuthCacheForUser(HttpServletRequest req, HttpServletResponse res) {
getAuthCacheService();
if (authCacheService == null) {
return;
}
String user = req.getRemoteUser();
if (user == null) {
Principal p = req.getUserPrincipal();
... | java |
public void throwExceptionIfAlreadyAuthenticate(HttpServletRequest req, HttpServletResponse resp, WebAppSecurityConfig config, String username) throws ServletException {
Subject callerSubject = subjectManager.getCallerSubject();
if (subjectHelper.isUnauthenticated(callerSubject))
return;
... | java |
private void invalidateSession(HttpServletRequest req) {
HttpSession session = req.getSession(false);
if (session != null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "invalidating existing HTTP Session");
session.invalidate();
... | java |
private void createSubjectAndPushItOnThreadAsNeeded(HttpServletRequest req, HttpServletResponse res) {
// We got a new instance of FormLogoutExtensionProcess every request.
logoutSubject = null;
Subject subject = subjectManager.getCallerSubject();
if (subject == null || subjectHelper.isU... | java |
String debugGetAllHttpHdrs(HttpServletRequest req) {
if (req == null)
return null;
StringBuffer sb = new StringBuffer(512);
Enumeration<String> headerNames = req.getHeaderNames();
while (headerNames != null && headerNames.hasMoreElements()) {
String headerName = h... | java |
public void processException(Class sourceClass,
String methodName,
Throwable throwable,
String probe) {
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(cclass,
... | java |
public static Properties loadRepoProperties() throws InstallException {
Properties repoProperties = null;
// Retrieves the Repository Properties file
File repoPropertiesFile = new File(getRepoPropertiesFileLocation());
//Check if default repository properties file location is overridde... | java |
public static String getRepoPropertiesFileLocation() {
String installDirPath = Utils.getInstallDir().getAbsolutePath();
String overrideLocation = System.getProperty(InstallConstants.OVERRIDE_PROPS_LOCATION_ENV_VAR);
//Gets the repository properties file path from the default location
if ... | java |
public static void setProxyAuthenticator(final String proxyHost, final String proxyPort, final String proxyUser, final String decodedPwd) {
if (proxyUser == null || proxyUser.isEmpty() || decodedPwd == null || decodedPwd.isEmpty()) {
return;
}
//Authenticate proxy credentials
... | java |
public static String getProxyPwd(Properties repoProperties) {
if (repoProperties.getProperty(InstallConstants.REPO_PROPERTIES_PROXY_USERPWD) != null)
return repoProperties.getProperty(InstallConstants.REPO_PROPERTIES_PROXY_USERPWD);
else if (repoProperties.getProperty(InstallConstants.REPO_P... | java |
public static List<String> getOrderList(Properties repoProperties) throws InstallException {
List<String> orderList = new ArrayList<String>();
List<String> repoList = new ArrayList<String>();
// Retrieves the Repository Properties file
File repoPropertiesFile = new File(getRepoProperties... | java |
public static boolean isWlpRepoEnabled(Properties repoProperties) {
if (!repoPropertiesFileExists() || repoProperties == null)
return true;
String wlpEnabled = repoProperties.getProperty(USE_WLP_REPO);
if (wlpEnabled == null)
return true;
return !wlpEnabled.trim()... | java |
public static List<RepositoryConfig> getRepositoryConfigs(Properties repoProperties) throws InstallException {
List<String> orderList = getOrderList(repoProperties);
List<RepositoryConfig> connections = new ArrayList<RepositoryConfig>(orderList.size());
if (repoProperties == null || repoProperti... | java |
public static String getRepoName(Properties repoProperties, RepositoryConnection repoConn) throws InstallException {
String repoName = null;
List<RepositoryConfig> configRepos = RepositoryConfigUtils.getRepositoryConfigs(repoProperties);
if (!(repoConn instanceof DirectoryRepositoryConnection |... | java |
public static boolean isLibertyRepository(RestRepositoryConnection lie, Properties repoProperties) throws InstallException {
if (isWlpRepoEnabled(repoProperties)) {
return lie.getRepositoryLocation().startsWith(InstallConstants.REPOSITORY_LIBERTY_URL);
}
return false;
} | java |
private static boolean isKeySupported(String key) {
if (Arrays.asList(SUPPORTED_KEYS).contains(key))
return true;
if (key.endsWith(URL_SUFFIX) || key.endsWith(APIKEY_SUFFIX) ||
key.endsWith(USER_SUFFIX) || key.endsWith(PWD_SUFFIX) || key.endsWith(USERPWD_SUFFIX))
retu... | java |
private boolean isFirstRequestProcessed()
{
FacesContext context = FacesContext.getCurrentInstance();
//if firstRequestProcessed is not set, check the application map
if(!_firstRequestProcessed && context != null
&& Boolean.TRUE.equals(context.getExternalContext().g... | java |
public static Object claimFromJsonObject(String jsonFormattedString, String claimName) throws JoseException {
Object claim = null;
// JSONObject jobj = JSONObject.parse(jsonFormattedString);
Map<String, Object> jobj = org.jose4j.json.JsonUtil.parseJson(jsonFormattedString);
if (jobj != null) {
claim = jobj.... | java |
public static Map claimsFromJsonObject(String jsonFormattedString) throws JoseException {
Map claimsMap = new ConcurrentHashMap<String, Object>();
// JSONObject jobj = JSONObject.parse(jsonFormattedString);
Map<String, Object> jobj = org.jose4j.json.JsonUtil.parseJson(jsonFormattedString);
Set<Entry<String, Ob... | java |
public static List<String> trimIt(String[] strings) {
if (strings == null || strings.length == 0) {
return null;
}
List<String> results = new ArrayList<String>();
for (int i = 0; i < strings.length; i++) {
String result = trimIt(strings[i]);
if (result != null) {
results.add(result);
}
}
... | java |
protected void invokeCollectorIfPresent() {
if (collectorProxy != null) {
Serializable data = collectorProxy.collectPartitionData();
logger.finer("Got partition data: " + data + ", from collector: " + collectorProxy);
sendCollectorDataPartitionReplyMsg(data);
}
} | java |
protected void sendCollectorDataPartitionReplyMsg(Serializable data) {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Sending collector partition data: " + data + " to analyzer queue: " + getPartitionReplyQueue());
}
PartitionReplyMsg msg = new PartitionReplyMsg( PartitionReplyMsgType.PARTIT... | java |
private void initialize(Chunk chunk)
{
final String mName = "initialize";
if(logger.isLoggable(Level.FINER))
logger.entering(className, mName);
try
{
if (chunk.getSkipLimit() != null){
_skipLimit = Integer.parseInt(chunk.getSkipLimit());
... | java |
@Trivial
public static String getSymbol(String s) {
String outputSymbol = null;
if (s != null) {
if (s.length() > 3) {
// ${} .. look for $
int pos = s.indexOf('$');
if (pos >= 0) {
// look for { after $
... | java |
public static String getChildUnder(String path, String parentPath) {
int start = parentPath.length();
String local = path.substring(start, path.length());
String name = getFirstPathComponent(local);
return name;
} | java |
public static boolean isNormalizedPathAbsolute(String nPath) {
boolean retval = "..".equals(nPath) || nPath.startsWith("../") || nPath.startsWith("/..");
//System.out.println("returning " + retval);
return !retval;
} | java |
public static String checkAndNormalizeRootPath(String path) throws IllegalArgumentException {
path = PathUtils.normalizeUnixStylePath(path);
//check the path is not trying to go upwards.
if (!PathUtils.isNormalizedPathAbsolute(path)) {
throw new IllegalArgumentException();
}... | java |
public static boolean checkCase(final File file, String pathToTest) {
if (pathToTest == null || pathToTest.isEmpty()) {
return true;
}
if (IS_OS_CASE_SENSITIVE) {
// It is assumed that the file exists. Therefore, its case must
// match if we know that the f... | java |
private static boolean checkCaseCanonical(final File file, String pathToTest) throws PrivilegedActionException {
// The canonical path returns the actual path on the file system so get this
String onDiskCanonicalPath = AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
/... | java |
private static boolean checkCaseSymlink(File file, String pathToTest) throws PrivilegedActionException {
// java.nio.Path.toRealPath(LinkOption.NOFOLLOW_LINKS) in java 7 seems to do what
// we are trying to do here
//On certain platforms, i.e. iSeries, the path starts with a slash.
//Re... | java |
private static boolean isSymbolicLink(final File file, File parentFile) throws PrivilegedActionException {
File canonicalParentDir = getCanonicalFile(parentFile);
File fileInCanonicalParentDir = new File(canonicalParentDir, file.getName());
File canonicalFile = getCanonicalFile(fileInCanonicalPa... | java |
protected void setVariableRegistry(ServiceReference<VariableRegistry> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setVariableRegistry", ref);
variableRegistryRef.setReference(ref);
} | java |
protected void unsetVariableRegistry(ServiceReference<VariableRegistry> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "unsetVariableRegistry", ref);
variableRegistryRef.unsetReference(ref);
} | java |
protected void setWsConfigurationHelper(ServiceReference<WSConfigurationHelper> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setWSConfigurationHelper", ref);
wsConfigurationHelperRef.setReference(ref);
} | java |
protected void unsetWsConfigurationHelper(ServiceReference<WSConfigurationHelper> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "unsetVariableRegistry", ref);
wsConfigurationHelperRef.unsetReference(ref);
} | java |
protected void setMetaTypeService(ServiceReference<MetaTypeService> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setMetaTypeService", ref);
metaTypeServiceRef.setReference(ref);
} | java |
protected void unsetMetaTypeService(ServiceReference<MetaTypeService> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "unsetMetaTypeService", ref);
metaTypeServiceRef.unsetReference(ref);
} | java |
private static <T> T getContextualReference(Class<T> type, BeanManager beanManager, Set<Bean<?>> beans)
{
Bean<?> bean = beanManager.resolve(beans);
//logWarningIfDependent(bean);
CreationalContext<?> creationalContext = beanManager.createCreationalContext(bean);
@SuppressWarnings... | java |
public static String printStatus(int status)
{
switch (status)
{
case Status.STATUS_ACTIVE:
return "Status.STATUS_ACTIVE";
case Status.STATUS_COMMITTED:
return "Status.STATUS_COMMITTED";
case Status.STATUS_COMMITTING:
return "Status.STATUS_... | java |
public static String printFlag(int flags)
{
StringBuffer sb = new StringBuffer();
sb.append(Integer.toHexString(flags));
sb.append("=");
if (flags == XAResource.TMNOFLAGS)
{
sb.append("TMNOFLAGS");
}
else
{
if ((flags & XAResou... | java |
public static String identity(java.lang.Object x)
{
if (x == null) return "" + x;
return(x.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(x)));
} | java |
public static byte[] duplicateByteArray(byte[] in, int offset, int length)
{
if (in == null) return null;
byte[] out = new byte[length];
System.arraycopy(in, offset, out, 0, length);
return out;
} | java |
public static void setBytesFromInt(byte[] bytes,
int offset,
int byteCount,
int value)
{
long maxval = ((1L << (8 * byteCount)) - 1);
if (value > maxval)
{
... | java |
public static long getLongFromBytes(byte[] bytes,
int offset)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "getLongFromBytes: length = " + bytes.length + ", data = " + toHexString(bytes));
long result = -1;
if (bytes.length >= offset + 8)
... | java |
public static byte[] longToBytes(long rmid)
{
return new byte[] { (byte)(rmid>>56), (byte)(rmid>>48), (byte)(rmid>>40), (byte)(rmid>>32),
(byte)(rmid>>24), (byte)(rmid>>16), (byte)(rmid>>8), (byte)(rmid)};
} | java |
public static boolean equal(byte[] a, byte[] b) {
if (a == b)
return (true);
if ((a == null) || (b == null))
return (false);
if (a.length != b.length)
return (false);
for (int i = 0; i < a.length; i++)
if (a[i] != b[i])
return (false);
... | java |
public static String byteArrayToString(byte[] b) {
final int l = b.length/2;
if (l*2 != b.length) throw new IllegalArgumentException();
StringBuffer result = new StringBuffer(l);
int o = 0;
for (int i = 0; i < l; i++)
{
int i1 = b[o++] & 0xff;
int i2 = b[o... | java |
public static String stackToDebugString(Throwable e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.close();
String text = sw.toString();
// Jump past the throwable
text = text.substring(text.indexO... | java |
@SuppressWarnings({ "unchecked", "rawtypes" })
public static String setPropertyAsNeeded(final String propName, final String propValue) {
String previousPropValue = (String) java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
@Override
public String run... | java |
public static void restorePropertyAsNeeded(final String propName, final String oldPropValue, final String newPropValue) {
java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Object>() {
@Override
public Object run() {
if (oldPropValue == null) {... | java |
protected void setSharedConnection(Object affinity, MCWrapper mcWrapper) {
final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
if (isTracingEnabled && tc.isEntryEnabled()) {
Tr.entry(this, tc, "setSharedConnection");
}
/*
* Set the shared pool af... | java |
protected void removeSharedConnection(MCWrapper mcWrapper) throws ResourceException {
final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
boolean removedSharedConnection = false;
if (isTracingEnabled && tc.isEntryEnabled()) {
Tr.entry(this, tc, "removeSharedConn... | java |
public void setDelegatedUsers(ArrayList<String> delegatedUsers) {
AuditThreadContext auditThreadContext = getAuditThreadContext();
auditThreadContext.setDelegatedUsers(delegatedUsers);
} | java |
public void setProvider(Object pObj) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "setProvider pre: pObj(class)=" + pObj.getClass() + " isProxy=" + Proxy.isProxyClass(pObj.getClass()) + " provider=" + (provider==null?"null":provider.getClass()) +
... | java |
protected JsonObject readJsonFromContent(Object contentToValidate) throws Exception {
if (contentToValidate == null) {
throw new Exception("Provided content is null so cannot be validated.");
}
JsonObject obj = null;
try {
String responseText = WebResponseUtils.ge... | java |
private void init(int max) {
if ((max != INTERNAL) && (max != PROVIDER) && (max != PRIVILEGED))
throw new IllegalArgumentException("invalid action");
if (max == NONE)
throw new IllegalArgumentException("missing action");
if (getName() == null)
throw new Null... | java |
private static int getMax(String action) {
int max = NONE;
if (action == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "WebSphereSecurityPermission action should not be null");
}
return max;
}
if (INTERNAL_STR.equalsIgnoreCase(acti... | java |
public void removeAll(Transaction tran) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAll", tran);
while(this.removeFirstMatching(null, tran) != null);
remove(tran, NO_LOCK_ID);
if (TraceComponent.isAnyTracingEnabled() &... | java |
protected final void setStorageStrategy(int setStrategy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setStorageStrategy", new Integer(setStrategy));
storageStrategy = setStrategy;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.e... | java |
public int getPersistentVersion()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getPersistentVersion");
SibTr.exit(tc, "getPersistentVersion", new Integer(DEFAULT_PERSISTENT_VERSION));
}
return DEFAULT_PERSISTENT_VERSION;
} | java |
public void addUnrestoredMsgId(long msgId)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addUnrestoredMsgId", new Long(msgId));
unrestoredMsgIds.add(new Long(msgId));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addUnr... | java |
public Collection clearUnrestoredMessages()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "clearUnrestoredMessages");
Collection returnCollection = unrestoredMsgIds;
// bug fix
unrestoredMsgIds = new ArrayList();
if (TraceComponent.isAnyTracingEnabled()... | java |
public void setBinding(String binding) throws JspException
{
if (!isValueReference(binding))
{
throw new IllegalArgumentException("not a valid binding: " + binding);
}
_binding = binding;
} | java |
public static UIComponentTag getParentUIComponentTag(PageContext pageContext)
{
UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext);
return parentTag instanceof UIComponentTag ? (UIComponentTag)parentTag : new UIComponentTagWrapper(parentTag);
} | java |
@Override
protected UIComponent createComponent(FacesContext context, String id)
{
String componentType = getComponentType();
if (componentType == null)
{
throw new NullPointerException("componentType");
}
if (_binding != null)
{
Applicati... | java |
protected boolean isSuppressed()
{
if (_suppressed == null)
{
// we haven't called this method before, so determine the suppressed
// value and cache it for later calls to this method.
if (isFacet())
{
// facets are always rendered by ... | java |
public void setData(List<DataSlice> dataSlices)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setData", "DataSlices="+dataSlices);
_dataSlices = dataSlices;
_estimatedLength = -1;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEna... | java |
@JSFProperty(deferredValueType="java.lang.Object")
public Locale getLocale()
{
if (_locale != null)
{
return _locale;
}
FacesContext context = FacesContext.getCurrentInstance();
return context.getViewRoot().getLocale();
} | java |
public static void useProvider(String className,String handlerName) {
_httpsProviderClass = null;
JSSE_PROVIDER_CLASS =className;
SSL_PROTOCOL_HANDLER =handlerName;
} | java |
public static Class getHttpsProviderClass() throws ClassNotFoundException {
if (_httpsProviderClass == null) {
// [ 1520925 ] SSL patch
Provider[] sslProviders = Security.getProviders("SSLContext.SSLv3");
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// IBM... | java |
private static void registerSSLProtocolHandler() {
String list = System.getProperty( PROTOCOL_HANDLER_PKGS );
if (list == null || list.length() == 0) {
System.setProperty( PROTOCOL_HANDLER_PKGS, SSL_PROTOCOL_HANDLER );
} else if (list.indexOf( SSL_PROTOCOL_HANDLER ) < 0) {
/... | java |
protected static int obtainIntConfigParameter(MessageStoreImpl msi, String parameterName, String defaultValue, int minValue, int maxValue)
{
int value = Integer.parseInt(defaultValue);
if (msi != null)
{
String strValue = msi.getProperty(parameterName, defaultValue);
... | java |
protected static long obtainLongConfigParameter(MessageStoreImpl msi, String parameterName, String defaultValue, long minValue, long maxValue)
{
long value = Long.parseLong(defaultValue);
if (msi != null)
{
String strValue = msi.getProperty(parameterName, defaultValue);
... | java |
public int originalFrame() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "originalFrame");
int result;
synchronized (getMessageLockArtefact()) {
if ((contents == null) || reallocated) {
result = -1;
}
else {
result = length;
... | java |
public boolean isPresent(int accessor) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) JmfTr.entry(this, tc, "isPresent", new Object[]{Integer.valueOf(accessor)});
boolean result;
if (accessor < cacheSize) {
result = super.isPresent(accessor);
}
else if (accessor < firstBo... | java |
public boolean setPosition(long position) {
try {
long fileSize = reader.length();
if (fileSize > position) {
reader.seek(position);
return true;
}
logger.logp(Level.SEVERE, className, "setPosition", "HPEL_OffsetBeyondFileSize", new Object[]{file, Long.valueOf(position), Long.valueOf(fileSize... | java |
public long getPosition() {
try {
return reader.getFilePointer();
} catch (IOException ex) {
logger.logp(Level.SEVERE, className, "getPosition", "HPEL_ErrorReadingFileOffset", new Object[]{file, ex.getMessage()});
}
return -1L;
} | java |
public RepositoryLogRecord findNext(long refSequenceNumber) {
if (nextRecord == null) {
nextRecord = getNext(refSequenceNumber);
}
if (nextRecord == null || refSequenceNumber >= 0 && refSequenceNumber < nextRecord.getInternalSeqNumber()) {
return null;
} else {
RepositoryLogRecord result = nextRecord;
... | java |
public long seekToNextRecord(LogRecordSerializer formatter) throws IOException {
long fileSize = reader.length();
long position = reader.getFilePointer();
int location;
int len = 0;
int offset = 0;
byte[] buffer = new byte[2048];
do {
if (offset > 0) {
position += len - offset;
// keep the l... | java |
public long seekToPrevRecord(LogRecordSerializer formatter) throws IOException {
long position = reader.getFilePointer();
byte[] buffer = new byte[2048];
int location;
int offset = 0;
int len = 0;
do {
if (position <= formatter.getEyeCatcherSize()+3) {
throw new IOException("No eyeCatcher found in th... | java |
protected LogFileReader createNewReader(LogFileReader other) throws IOException {
if (other instanceof LogFileReaderImpl) {
return new LogFileReaderImpl((LogFileReaderImpl)other);
}
throw new IOException("Instance of the " + other.getClass().getName() + " is not clonable by " + OneLogFileRecordIterator.class.g... | java |
public final void persistLock(final Transaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException
{
Membership membership = _getMembership();
if (null == membership)
{
throw new NotInMessageStore();
}
membership.persistLock(t... | java |
public void persistRedeliveredCount(int redeliveredCount) throws SevereMessageStoreException
{
Membership thisItemLink = _getMembership();
if (null == thisItemLink)
{
throw new NotInMessageStore();
}
thisItemLink.persistRedeliveredCount(redeliveredCount);
} | java |
public final void requestUpdate(Transaction transaction) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "requestUpdate", transaction);
Membership membership = _getMembership();
if (null == membership)
... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.