repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java | RaXmlGen.writeInbound | private void writeInbound(Definition def, Writer out, int indent) throws IOException
{
writeIndent(out, indent);
out.write("<inbound-resourceadapter>");
writeEol(out);
writeIndent(out, indent + 1);
out.write("<messageadapter>");
writeEol(out);
writeIndent(out, indent + 2);
... | java | private void writeInbound(Definition def, Writer out, int indent) throws IOException
{
writeIndent(out, indent);
out.write("<inbound-resourceadapter>");
writeEol(out);
writeIndent(out, indent + 1);
out.write("<messageadapter>");
writeEol(out);
writeIndent(out, indent + 2);
... | [
"private",
"void",
"writeInbound",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeIndent",
"(",
"out",
",",
"indent",
")",
";",
"out",
".",
"write",
"(",
"\"<inbound-resourceadapter>\"",
")",
";... | Output inbound xml part
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"inbound",
"xml",
"part"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java#L243-L286 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java | Main.main | public static void main(String[] args)
{
String outputDir = "out"; //default output directory
String defxml = null;
int arg = 0;
if (args.length > 0)
{
while (args.length > arg + 1)
{
if (args[arg].startsWith("-"))
{
if (args[arg... | java | public static void main(String[] args)
{
String outputDir = "out"; //default output directory
String defxml = null;
int arg = 0;
if (args.length > 0)
{
while (args.length > arg + 1)
{
if (args[arg].startsWith("-"))
{
if (args[arg... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"String",
"outputDir",
"=",
"\"out\"",
";",
"//default output directory",
"String",
"defxml",
"=",
"null",
";",
"int",
"arg",
"=",
"0",
";",
"if",
"(",
"args",
".",
"length",
... | Code generator stand alone tool
@param args command line arguments | [
"Code",
"generator",
"stand",
"alone",
"tool"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java#L65-L151 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java | Main.inputFromXml | private static Definition inputFromXml(String defxml) throws IOException, JAXBException
{
JAXBContext context = JAXBContext.newInstance("org.ironjacamar.codegenerator");
Unmarshaller unmarshaller = context.createUnmarshaller();
return (Definition) unmarshaller.unmarshal(new File(defxml));
} | java | private static Definition inputFromXml(String defxml) throws IOException, JAXBException
{
JAXBContext context = JAXBContext.newInstance("org.ironjacamar.codegenerator");
Unmarshaller unmarshaller = context.createUnmarshaller();
return (Definition) unmarshaller.unmarshal(new File(defxml));
} | [
"private",
"static",
"Definition",
"inputFromXml",
"(",
"String",
"defxml",
")",
"throws",
"IOException",
",",
"JAXBException",
"{",
"JAXBContext",
"context",
"=",
"JAXBContext",
".",
"newInstance",
"(",
"\"org.ironjacamar.codegenerator\"",
")",
";",
"Unmarshaller",
"... | input from xml file
@param defxml definition xml file
@return Definition definition from input
@throws IOException ioException
@throws JAXBException jaxb exception | [
"input",
"from",
"xml",
"file"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java#L161-L167 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java | Main.setDefaultValue | private static void setDefaultValue(Definition def, String className, String stringValue)
{
if (className.endsWith(stringValue))
def.setDefaultValue(className.substring(0, className.length() - stringValue.length()));
} | java | private static void setDefaultValue(Definition def, String className, String stringValue)
{
if (className.endsWith(stringValue))
def.setDefaultValue(className.substring(0, className.length() - stringValue.length()));
} | [
"private",
"static",
"void",
"setDefaultValue",
"(",
"Definition",
"def",
",",
"String",
"className",
",",
"String",
"stringValue",
")",
"{",
"if",
"(",
"className",
".",
"endsWith",
"(",
"stringValue",
")",
")",
"def",
".",
"setDefaultValue",
"(",
"className"... | check defalut value and set it
@param def definition
@param className the class name
@param stringValue post-fix string | [
"check",
"defalut",
"value",
"and",
"set",
"it"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java#L788-L792 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java | Main.copyAllJars | private static void copyAllJars(String outputDir) throws IOException
{
File out = new File(outputDir);
String targetPath = out.getAbsolutePath() + File.separatorChar + "lib";
File current = new File(".");
String path = current.getCanonicalPath();
String libPath = path + File.separator... | java | private static void copyAllJars(String outputDir) throws IOException
{
File out = new File(outputDir);
String targetPath = out.getAbsolutePath() + File.separatorChar + "lib";
File current = new File(".");
String path = current.getCanonicalPath();
String libPath = path + File.separator... | [
"private",
"static",
"void",
"copyAllJars",
"(",
"String",
"outputDir",
")",
"throws",
"IOException",
"{",
"File",
"out",
"=",
"new",
"File",
"(",
"outputDir",
")",
";",
"String",
"targetPath",
"=",
"out",
".",
"getAbsolutePath",
"(",
")",
"+",
"File",
"."... | copy all jars
@param outputDir output directory
@throws IOException ioException | [
"copy",
"all",
"jars"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/Main.java#L800-L812 | train |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/Main.java | Main.loadProperties | private static Properties loadProperties()
{
Properties properties = new Properties();
boolean loaded = false;
String sysProperty = SecurityActions.getSystemProperty("ironjacamar.options");
if (sysProperty != null && !sysProperty.equals(""))
{
File file = new File(sysProperty)... | java | private static Properties loadProperties()
{
Properties properties = new Properties();
boolean loaded = false;
String sysProperty = SecurityActions.getSystemProperty("ironjacamar.options");
if (sysProperty != null && !sysProperty.equals(""))
{
File file = new File(sysProperty)... | [
"private",
"static",
"Properties",
"loadProperties",
"(",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"boolean",
"loaded",
"=",
"false",
";",
"String",
"sysProperty",
"=",
"SecurityActions",
".",
"getSystemProperty",
"(",
"\"ir... | Load configuration values specified from either a file or the classloader
@return The properties | [
"Load",
"configuration",
"values",
"specified",
"from",
"either",
"a",
"file",
"or",
"the",
"classloader"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/Main.java#L316-L419 | train |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/Main.java | Main.configurationString | private static String configurationString(Properties properties, String key, String defaultValue)
{
if (properties != null)
{
return properties.getProperty(key, defaultValue);
}
return defaultValue;
} | java | private static String configurationString(Properties properties, String key, String defaultValue)
{
if (properties != null)
{
return properties.getProperty(key, defaultValue);
}
return defaultValue;
} | [
"private",
"static",
"String",
"configurationString",
"(",
"Properties",
"properties",
",",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"return",
"properties",
".",
"getProperty",
"(",
"key",
",",
... | Get configuration string
@param properties The properties
@param key The key
@param defaultValue The default value
@return The value | [
"Get",
"configuration",
"string"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/Main.java#L428-L436 | train |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/Main.java | Main.configurationBoolean | private static boolean configurationBoolean(Properties properties, String key, boolean defaultValue)
{
if (properties != null)
{
if (properties.containsKey(key))
return Boolean.valueOf(properties.getProperty(key));
}
return defaultValue;
} | java | private static boolean configurationBoolean(Properties properties, String key, boolean defaultValue)
{
if (properties != null)
{
if (properties.containsKey(key))
return Boolean.valueOf(properties.getProperty(key));
}
return defaultValue;
} | [
"private",
"static",
"boolean",
"configurationBoolean",
"(",
"Properties",
"properties",
",",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"key",
... | Get configuration boolean
@param properties The properties
@param key The key
@param defaultValue The default value
@return The value | [
"Get",
"configuration",
"boolean"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/Main.java#L445-L454 | train |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/Main.java | Main.configurationInteger | private static int configurationInteger(Properties properties, String key, int defaultValue)
{
if (properties != null)
{
if (properties.containsKey(key))
return Integer.valueOf(properties.getProperty(key));
}
return defaultValue;
} | java | private static int configurationInteger(Properties properties, String key, int defaultValue)
{
if (properties != null)
{
if (properties.containsKey(key))
return Integer.valueOf(properties.getProperty(key));
}
return defaultValue;
} | [
"private",
"static",
"int",
"configurationInteger",
"(",
"Properties",
"properties",
",",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"key",
")",
... | Get configuration integer
@param properties The properties
@param key The key
@param defaultValue The default value
@return The value | [
"Get",
"configuration",
"integer"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/Main.java#L463-L472 | train |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/Main.java | Main.applySystemProperties | private static void applySystemProperties(Properties properties)
{
if (properties != null)
{
for (Map.Entry<Object, Object> entry : properties.entrySet())
{
String key = (String)entry.getKey();
if (key.startsWith("system.property."))
{
... | java | private static void applySystemProperties(Properties properties)
{
if (properties != null)
{
for (Map.Entry<Object, Object> entry : properties.entrySet())
{
String key = (String)entry.getKey();
if (key.startsWith("system.property."))
{
... | [
"private",
"static",
"void",
"applySystemProperties",
"(",
"Properties",
"properties",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Object",
",",
"Object",
">",
"entry",
":",
"properties",
".",
"entrySet... | Apply any defined system properties
@param properties The properties | [
"Apply",
"any",
"defined",
"system",
"properties"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/Main.java#L478-L492 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkClassLoader.java | WorkClassLoader.setResourceAdapterClassLoader | public void setResourceAdapterClassLoader(ResourceAdapterClassLoader v)
{
if (trace)
log.tracef("%s: setResourceAdapterClassLoader(%s)", Integer.toHexString(System.identityHashCode(this)), v);
resourceAdapterClassLoader = v;
} | java | public void setResourceAdapterClassLoader(ResourceAdapterClassLoader v)
{
if (trace)
log.tracef("%s: setResourceAdapterClassLoader(%s)", Integer.toHexString(System.identityHashCode(this)), v);
resourceAdapterClassLoader = v;
} | [
"public",
"void",
"setResourceAdapterClassLoader",
"(",
"ResourceAdapterClassLoader",
"v",
")",
"{",
"if",
"(",
"trace",
")",
"log",
".",
"tracef",
"(",
"\"%s: setResourceAdapterClassLoader(%s)\"",
",",
"Integer",
".",
"toHexString",
"(",
"System",
".",
"identityHashC... | Set the resource adapter class loader
@param v The value | [
"Set",
"the",
"resource",
"adapter",
"class",
"loader"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkClassLoader.java#L95-L101 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/naming/Util.java | Util.bind | private static void bind(Context ctx, Name name, Object value) throws NamingException
{
int size = name.size();
String atom = name.get(size - 1);
Context parentCtx = createSubcontext(ctx, name.getPrefix(size - 1));
parentCtx.bind(atom, value);
} | java | private static void bind(Context ctx, Name name, Object value) throws NamingException
{
int size = name.size();
String atom = name.get(size - 1);
Context parentCtx = createSubcontext(ctx, name.getPrefix(size - 1));
parentCtx.bind(atom, value);
} | [
"private",
"static",
"void",
"bind",
"(",
"Context",
"ctx",
",",
"Name",
"name",
",",
"Object",
"value",
")",
"throws",
"NamingException",
"{",
"int",
"size",
"=",
"name",
".",
"size",
"(",
")",
";",
"String",
"atom",
"=",
"name",
".",
"get",
"(",
"s... | Bind val to name in ctx, and make sure that all intermediate contexts exist
@param ctx the parent JNDI Context under which value will be bound
@param name the name relative to ctx where value will be bound
@param value the value to bind.
@throws NamingException for any error | [
"Bind",
"val",
"to",
"name",
"in",
"ctx",
"and",
"make",
"sure",
"that",
"all",
"intermediate",
"contexts",
"exist"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/naming/Util.java#L89-L95 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/tx/noopts/TxRegistry.java | TxRegistry.startTransaction | public void startTransaction()
{
Long key = Long.valueOf(Thread.currentThread().getId());
TransactionImpl tx = txs.get(key);
if (tx == null)
{
TransactionImpl newTx = new TransactionImpl(key);
tx = txs.putIfAbsent(key, newTx);
if (tx == null)
tx = newTx... | java | public void startTransaction()
{
Long key = Long.valueOf(Thread.currentThread().getId());
TransactionImpl tx = txs.get(key);
if (tx == null)
{
TransactionImpl newTx = new TransactionImpl(key);
tx = txs.putIfAbsent(key, newTx);
if (tx == null)
tx = newTx... | [
"public",
"void",
"startTransaction",
"(",
")",
"{",
"Long",
"key",
"=",
"Long",
".",
"valueOf",
"(",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getId",
"(",
")",
")",
";",
"TransactionImpl",
"tx",
"=",
"txs",
".",
"get",
"(",
"key",
")",
";",
... | Start a transaction | [
"Start",
"a",
"transaction"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/tx/noopts/TxRegistry.java#L59-L73 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/tx/noopts/TxRegistry.java | TxRegistry.commitTransaction | public void commitTransaction() throws SystemException
{
Long key = Long.valueOf(Thread.currentThread().getId());
TransactionImpl tx = txs.get(key);
if (tx != null)
{
try
{
tx.commit();
}
catch (Throwable t)
{
SystemExceptio... | java | public void commitTransaction() throws SystemException
{
Long key = Long.valueOf(Thread.currentThread().getId());
TransactionImpl tx = txs.get(key);
if (tx != null)
{
try
{
tx.commit();
}
catch (Throwable t)
{
SystemExceptio... | [
"public",
"void",
"commitTransaction",
"(",
")",
"throws",
"SystemException",
"{",
"Long",
"key",
"=",
"Long",
".",
"valueOf",
"(",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getId",
"(",
")",
")",
";",
"TransactionImpl",
"tx",
"=",
"txs",
".",
"get... | Commit a transaction
@exception SystemException Thrown if an error occurs | [
"Commit",
"a",
"transaction"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/tx/noopts/TxRegistry.java#L79-L100 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/tx/noopts/TxRegistry.java | TxRegistry.assignTransaction | public void assignTransaction(TransactionImpl v)
{
txs.put(Long.valueOf(Thread.currentThread().getId()), v);
} | java | public void assignTransaction(TransactionImpl v)
{
txs.put(Long.valueOf(Thread.currentThread().getId()), v);
} | [
"public",
"void",
"assignTransaction",
"(",
"TransactionImpl",
"v",
")",
"{",
"txs",
".",
"put",
"(",
"Long",
".",
"valueOf",
"(",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getId",
"(",
")",
")",
",",
"v",
")",
";",
"}"
] | Assign a transaction
@param v The value | [
"Assign",
"a",
"transaction"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/tx/noopts/TxRegistry.java#L133-L136 | train |
ironjacamar/ironjacamar | validator/src/main/java/org/ironjacamar/validator/maven/SecurityActions.java | SecurityActions.getClassLoader | public static ClassLoader getClassLoader(final Class<?> c)
{
if (System.getSecurityManager() == null)
return c.getClassLoader();
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
public ClassLoader run()
{
return c.getClassLoader();
... | java | public static ClassLoader getClassLoader(final Class<?> c)
{
if (System.getSecurityManager() == null)
return c.getClassLoader();
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
public ClassLoader run()
{
return c.getClassLoader();
... | [
"public",
"static",
"ClassLoader",
"getClassLoader",
"(",
"final",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"return",
"c",
".",
"getClassLoader",
"(",
")",
";",
"return",
"AccessC... | Get the classloader.
@param c The class
@return The classloader | [
"Get",
"the",
"classloader",
"."
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/validator/src/main/java/org/ironjacamar/validator/maven/SecurityActions.java#L38-L50 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java | StringUtils.restoreExpression | public static String restoreExpression(Map<String, String> m, String key, String subkey, String v)
{
String k = key;
if (subkey != null)
{
if (!isIncorrectExpression(subkey) && subkey.startsWith("${"))
{
subkey = subkey.substring(2, subkey.length() - 1);
... | java | public static String restoreExpression(Map<String, String> m, String key, String subkey, String v)
{
String k = key;
if (subkey != null)
{
if (!isIncorrectExpression(subkey) && subkey.startsWith("${"))
{
subkey = subkey.substring(2, subkey.length() - 1);
... | [
"public",
"static",
"String",
"restoreExpression",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"m",
",",
"String",
"key",
",",
"String",
"subkey",
",",
"String",
"v",
")",
"{",
"String",
"k",
"=",
"key",
";",
"if",
"(",
"subkey",
"!=",
"null",
")"... | Restores expression with substituted default value
@param m a Map with expressions
@param key of the Map
@param subkey of the Map
@param v value for substitution
@return restored expression string | [
"Restores",
"expression",
"with",
"substituted",
"default",
"value"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java#L46-L65 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java | StringUtils.substituteValueInExpression | public static String substituteValueInExpression(String expression, String newValue)
{
ExpressionTemplate t = new ExpressionTemplate(expression);
if (newValue != null && (getExpressionKey(t.getTemplate()) == null ||
(t.isComplex() && !newValue.equals(t.getValue()))))
return newValue... | java | public static String substituteValueInExpression(String expression, String newValue)
{
ExpressionTemplate t = new ExpressionTemplate(expression);
if (newValue != null && (getExpressionKey(t.getTemplate()) == null ||
(t.isComplex() && !newValue.equals(t.getValue()))))
return newValue... | [
"public",
"static",
"String",
"substituteValueInExpression",
"(",
"String",
"expression",
",",
"String",
"newValue",
")",
"{",
"ExpressionTemplate",
"t",
"=",
"new",
"ExpressionTemplate",
"(",
"expression",
")",
";",
"if",
"(",
"newValue",
"!=",
"null",
"&&",
"(... | Substitutes a default value in expression by a new one
@param expression to check
@param newValue to substitute
@return resulting expression | [
"Substitutes",
"a",
"default",
"value",
"in",
"expression",
"by",
"a",
"new",
"one"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java#L73-L93 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java | StringUtils.getExpressionKey | public static String getExpressionKey(String result)
{
if (result == null)
return null;
try
{
int from = result.indexOf(startTag);
int to = result.indexOf(endTag, from);
Integer.parseInt(result.substring(from + 5, to));
return result.substring(from, to +... | java | public static String getExpressionKey(String result)
{
if (result == null)
return null;
try
{
int from = result.indexOf(startTag);
int to = result.indexOf(endTag, from);
Integer.parseInt(result.substring(from + 5, to));
return result.substring(from, to +... | [
"public",
"static",
"String",
"getExpressionKey",
"(",
"String",
"result",
")",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{",
"int",
"from",
"=",
"result",
".",
"indexOf",
"(",
"startTag",
")",
";",
"int",
"to",
"=",
... | Get an entities map key from the string
@param result the string where to find the key
@return the key or null if nothing was found | [
"Get",
"an",
"entities",
"map",
"key",
"from",
"the",
"string"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/StringUtils.java#L140-L155 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaCodeGen.java | RaCodeGen.writeXAResource | private void writeXAResource(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * This method is called by the application server during crash recovery.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(o... | java | private void writeXAResource(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * This method is called by the application server during crash recovery.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(o... | [
"private",
"void",
"writeXAResource",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"ind... | Output getXAResources method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"getXAResources",
"method"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaCodeGen.java#L223-L240 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaCodeGen.java | RaCodeGen.writeEndpointLifecycle | private void writeEndpointLifecycle(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * This is called during the activation of a message endpoint.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, ... | java | private void writeEndpointLifecycle(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * This is called during the activation of a message endpoint.\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, ... | [
"private",
"void",
"writeEndpointLifecycle",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",... | Output EndpointLifecycle method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"EndpointLifecycle",
"method"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/RaCodeGen.java#L286-L334 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/ActivationCodeGen.java | ActivationCodeGen.writeGetAs | private void writeGetAs(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Get activation spec class\n");
writeWithIndent(out, indent, " * @return Activation spec\n");
writeWithIndent(out, indent, " */\n");
... | java | private void writeGetAs(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Get activation spec class\n");
writeWithIndent(out, indent, " * @return Activation spec\n");
writeWithIndent(out, indent, " */\n");
... | [
"private",
"void",
"writeGetAs",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"indent",... | Output get activation spec method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"get",
"activation",
"spec",
"method"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/ActivationCodeGen.java#L136-L149 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/ActivationCodeGen.java | ActivationCodeGen.writeMef | private void writeMef(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Get message endpoint factory\n");
writeWithIndent(out, indent, " * @return Message endpoint factory\n");
writeWithIndent(out, indent, " */... | java | private void writeMef(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Get message endpoint factory\n");
writeWithIndent(out, indent, " * @return Message endpoint factory\n");
writeWithIndent(out, indent, " */... | [
"private",
"void",
"writeMef",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"indent",
... | Output message endpoint factory method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"message",
"endpoint",
"factory",
"method"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/ActivationCodeGen.java#L159-L172 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java | WorkManagerCoordinator.unregisterWorkManager | public void unregisterWorkManager(WorkManager wm)
{
if (wm != null)
{
if (wm.getName() == null || wm.getName().trim().equals(""))
throw new IllegalArgumentException("The name of WorkManager is invalid: " + wm);
if (trace)
log.tracef("Unregistering WorkManager: %... | java | public void unregisterWorkManager(WorkManager wm)
{
if (wm != null)
{
if (wm.getName() == null || wm.getName().trim().equals(""))
throw new IllegalArgumentException("The name of WorkManager is invalid: " + wm);
if (trace)
log.tracef("Unregistering WorkManager: %... | [
"public",
"void",
"unregisterWorkManager",
"(",
"WorkManager",
"wm",
")",
"{",
"if",
"(",
"wm",
"!=",
"null",
")",
"{",
"if",
"(",
"wm",
".",
"getName",
"(",
")",
"==",
"null",
"||",
"wm",
".",
"getName",
"(",
")",
".",
"trim",
"(",
")",
".",
"eq... | Unregister work manager
@param wm The work manager | [
"Unregister",
"work",
"manager"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java#L182-L205 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java | WorkManagerCoordinator.setDefaultWorkManager | public void setDefaultWorkManager(WorkManager wm)
{
if (trace)
log.tracef("Default WorkManager: %s", wm);
String currentName = null;
if (defaultWorkManager != null)
currentName = defaultWorkManager.getName();
defaultWorkManager = wm;
if (wm != null)
{
... | java | public void setDefaultWorkManager(WorkManager wm)
{
if (trace)
log.tracef("Default WorkManager: %s", wm);
String currentName = null;
if (defaultWorkManager != null)
currentName = defaultWorkManager.getName();
defaultWorkManager = wm;
if (wm != null)
{
... | [
"public",
"void",
"setDefaultWorkManager",
"(",
"WorkManager",
"wm",
")",
"{",
"if",
"(",
"trace",
")",
"log",
".",
"tracef",
"(",
"\"Default WorkManager: %s\"",
",",
"wm",
")",
";",
"String",
"currentName",
"=",
"null",
";",
"if",
"(",
"defaultWorkManager",
... | Set the default work manager
@param wm The work manager | [
"Set",
"the",
"default",
"work",
"manager"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java#L220-L240 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java | WorkManagerCoordinator.resolveDistributedWorkManager | public DistributedWorkManager resolveDistributedWorkManager(Address address)
{
if (trace)
{
log.tracef("resolveDistributedWorkManager(%s)", address);
log.tracef(" ActiveWorkManagers: %s", activeWorkmanagers);
}
WorkManager wm = activeWorkmanagers.get(address.getWorkManager... | java | public DistributedWorkManager resolveDistributedWorkManager(Address address)
{
if (trace)
{
log.tracef("resolveDistributedWorkManager(%s)", address);
log.tracef(" ActiveWorkManagers: %s", activeWorkmanagers);
}
WorkManager wm = activeWorkmanagers.get(address.getWorkManager... | [
"public",
"DistributedWorkManager",
"resolveDistributedWorkManager",
"(",
"Address",
"address",
")",
"{",
"if",
"(",
"trace",
")",
"{",
"log",
".",
"tracef",
"(",
"\"resolveDistributedWorkManager(%s)\"",
",",
"address",
")",
";",
"log",
".",
"tracef",
"(",
"\" Ac... | Resolve a distributed work manager
@param address The work manager address
@return The value | [
"Resolve",
"a",
"distributed",
"work",
"manager"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java#L302-L361 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java | WorkManagerCoordinator.createWorkManager | public synchronized WorkManager createWorkManager(String id, String name)
{
if (id == null || id.trim().equals(""))
throw new IllegalArgumentException("The id of WorkManager is invalid: " + id);
// Check for an active work manager
if (activeWorkmanagers.keySet().contains(id))
{
... | java | public synchronized WorkManager createWorkManager(String id, String name)
{
if (id == null || id.trim().equals(""))
throw new IllegalArgumentException("The id of WorkManager is invalid: " + id);
// Check for an active work manager
if (activeWorkmanagers.keySet().contains(id))
{
... | [
"public",
"synchronized",
"WorkManager",
"createWorkManager",
"(",
"String",
"id",
",",
"String",
"name",
")",
"{",
"if",
"(",
"id",
"==",
"null",
"||",
"id",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"throw",
"new",
"IllegalArgumentEx... | Create a work manager
@param id The id of the work manager
@param name The name of the work manager; if <code>null</code> default value is used
@return The work manager | [
"Create",
"a",
"work",
"manager"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java#L369-L450 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java | WorkManagerCoordinator.removeWorkManager | public synchronized void removeWorkManager(String id)
{
if (id == null || id.trim().equals(""))
throw new IllegalArgumentException("The id of WorkManager is invalid: " + id);
Integer i = refCountWorkmanagers.get(id);
if (i != null)
{
int newValue = i.intValue() - 1;
... | java | public synchronized void removeWorkManager(String id)
{
if (id == null || id.trim().equals(""))
throw new IllegalArgumentException("The id of WorkManager is invalid: " + id);
Integer i = refCountWorkmanagers.get(id);
if (i != null)
{
int newValue = i.intValue() - 1;
... | [
"public",
"synchronized",
"void",
"removeWorkManager",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"null",
"||",
"id",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The id of Work... | Remove a work manager
@param id The id of the work manager | [
"Remove",
"a",
"work",
"manager"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerCoordinator.java#L456-L489 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/spec/ResourceAdapterImpl.java | ResourceAdapterImpl.forceAdminObjects | public synchronized void forceAdminObjects(List<AdminObject> newContent)
{
if (newContent != null)
{
this.adminobjects = new ArrayList<AdminObject>(newContent);
}
else
{
this.adminobjects = new ArrayList<AdminObject>(0);
}
} | java | public synchronized void forceAdminObjects(List<AdminObject> newContent)
{
if (newContent != null)
{
this.adminobjects = new ArrayList<AdminObject>(newContent);
}
else
{
this.adminobjects = new ArrayList<AdminObject>(0);
}
} | [
"public",
"synchronized",
"void",
"forceAdminObjects",
"(",
"List",
"<",
"AdminObject",
">",
"newContent",
")",
"{",
"if",
"(",
"newContent",
"!=",
"null",
")",
"{",
"this",
".",
"adminobjects",
"=",
"new",
"ArrayList",
"<",
"AdminObject",
">",
"(",
"newCont... | Force adminobjects with new content.
This method is thread safe
@param newContent the list of new properties | [
"Force",
"adminobjects",
"with",
"new",
"content",
".",
"This",
"method",
"is",
"thread",
"safe"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/spec/ResourceAdapterImpl.java#L184-L194 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java | PoolStatisticsImpl.deltaTotalBlockingTime | public void deltaTotalBlockingTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalBlockingTime.addAndGet(delta);
totalBlockingTimeInvocations.incrementAndGet();
if (delta > maxWaitTime.get())
maxWaitTime.set(delta);
}
} | java | public void deltaTotalBlockingTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalBlockingTime.addAndGet(delta);
totalBlockingTimeInvocations.incrementAndGet();
if (delta > maxWaitTime.get())
maxWaitTime.set(delta);
}
} | [
"public",
"void",
"deltaTotalBlockingTime",
"(",
"long",
"delta",
")",
"{",
"if",
"(",
"enabled",
".",
"get",
"(",
")",
"&&",
"delta",
">",
"0",
")",
"{",
"totalBlockingTime",
".",
"addAndGet",
"(",
"delta",
")",
";",
"totalBlockingTimeInvocations",
".",
"... | Add delta to total blocking timeout
@param delta The value | [
"Add",
"delta",
"to",
"total",
"blocking",
"timeout"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java#L981-L991 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java | PoolStatisticsImpl.deltaTotalCreationTime | public void deltaTotalCreationTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalCreationTime.addAndGet(delta);
if (delta > maxCreationTime.get())
maxCreationTime.set(delta);
}
} | java | public void deltaTotalCreationTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalCreationTime.addAndGet(delta);
if (delta > maxCreationTime.get())
maxCreationTime.set(delta);
}
} | [
"public",
"void",
"deltaTotalCreationTime",
"(",
"long",
"delta",
")",
"{",
"if",
"(",
"enabled",
".",
"get",
"(",
")",
"&&",
"delta",
">",
"0",
")",
"{",
"totalCreationTime",
".",
"addAndGet",
"(",
"delta",
")",
";",
"if",
"(",
"delta",
">",
"maxCreat... | Add delta to total creation time
@param delta The value | [
"Add",
"delta",
"to",
"total",
"creation",
"time"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java#L1008-L1017 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java | PoolStatisticsImpl.deltaTotalGetTime | public void deltaTotalGetTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalGetTime.addAndGet(delta);
totalGetTimeInvocations.incrementAndGet();
if (delta > maxGetTime.get())
maxGetTime.set(delta);
}
} | java | public void deltaTotalGetTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalGetTime.addAndGet(delta);
totalGetTimeInvocations.incrementAndGet();
if (delta > maxGetTime.get())
maxGetTime.set(delta);
}
} | [
"public",
"void",
"deltaTotalGetTime",
"(",
"long",
"delta",
")",
"{",
"if",
"(",
"enabled",
".",
"get",
"(",
")",
"&&",
"delta",
">",
"0",
")",
"{",
"totalGetTime",
".",
"addAndGet",
"(",
"delta",
")",
";",
"totalGetTimeInvocations",
".",
"incrementAndGet... | Add delta to total get time
@param delta The value | [
"Add",
"delta",
"to",
"total",
"get",
"time"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java#L1034-L1044 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java | PoolStatisticsImpl.deltaTotalPoolTime | public void deltaTotalPoolTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalPoolTime.addAndGet(delta);
totalPoolTimeInvocations.incrementAndGet();
if (delta > maxPoolTime.get())
maxPoolTime.set(delta);
}
} | java | public void deltaTotalPoolTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalPoolTime.addAndGet(delta);
totalPoolTimeInvocations.incrementAndGet();
if (delta > maxPoolTime.get())
maxPoolTime.set(delta);
}
} | [
"public",
"void",
"deltaTotalPoolTime",
"(",
"long",
"delta",
")",
"{",
"if",
"(",
"enabled",
".",
"get",
"(",
")",
"&&",
"delta",
">",
"0",
")",
"{",
"totalPoolTime",
".",
"addAndGet",
"(",
"delta",
")",
";",
"totalPoolTimeInvocations",
".",
"incrementAnd... | Add delta to total pool time
@param delta The value | [
"Add",
"delta",
"to",
"total",
"pool",
"time"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java#L1061-L1071 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java | PoolStatisticsImpl.deltaTotalUsageTime | public void deltaTotalUsageTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalUsageTime.addAndGet(delta);
totalUsageTimeInvocations.incrementAndGet();
if (delta > maxUsageTime.get())
maxUsageTime.set(delta);
}
} | java | public void deltaTotalUsageTime(long delta)
{
if (enabled.get() && delta > 0)
{
totalUsageTime.addAndGet(delta);
totalUsageTimeInvocations.incrementAndGet();
if (delta > maxUsageTime.get())
maxUsageTime.set(delta);
}
} | [
"public",
"void",
"deltaTotalUsageTime",
"(",
"long",
"delta",
")",
"{",
"if",
"(",
"enabled",
".",
"get",
"(",
")",
"&&",
"delta",
">",
"0",
")",
"{",
"totalUsageTime",
".",
"addAndGet",
"(",
"delta",
")",
";",
"totalUsageTimeInvocations",
".",
"increment... | Add delta to total usage time
@param delta The value | [
"Add",
"delta",
"to",
"total",
"usage",
"time"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/PoolStatisticsImpl.java#L1088-L1098 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/deploymentrepository/ResourceAdapterImpl.java | ResourceAdapterImpl.verifyBeanValidation | @SuppressWarnings("unchecked")
private void verifyBeanValidation(Object as) throws Exception
{
if (beanValidation != null)
{
ValidatorFactory vf = null;
try
{
vf = beanValidation.getValidatorFactory();
Validator v = vf.getValidator();
Co... | java | @SuppressWarnings("unchecked")
private void verifyBeanValidation(Object as) throws Exception
{
if (beanValidation != null)
{
ValidatorFactory vf = null;
try
{
vf = beanValidation.getValidatorFactory();
Validator v = vf.getValidator();
Co... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"verifyBeanValidation",
"(",
"Object",
"as",
")",
"throws",
"Exception",
"{",
"if",
"(",
"beanValidation",
"!=",
"null",
")",
"{",
"ValidatorFactory",
"vf",
"=",
"null",
";",
"try",
"{",
... | Verify activation spec against bean validation
@param as The activation spec
@exception Exception Thrown in case of a violation | [
"Verify",
"activation",
"spec",
"against",
"bean",
"validation"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/deploymentrepository/ResourceAdapterImpl.java#L316-L351 | train |
ironjacamar/ironjacamar | tracer/src/main/java/org/ironjacamar/tracer/HTMLReport.java | HTMLReport.generateToCManagedConnection | private static void generateToCManagedConnection(Map<String, TraceEvent> events, FileWriter fw)
throws Exception
{
writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
writeEOL(fw);
writeString(fw, " \"http://www.w3.org/TR/html4/loose.dtd\"... | java | private static void generateToCManagedConnection(Map<String, TraceEvent> events, FileWriter fw)
throws Exception
{
writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
writeEOL(fw);
writeString(fw, " \"http://www.w3.org/TR/html4/loose.dtd\"... | [
"private",
"static",
"void",
"generateToCManagedConnection",
"(",
"Map",
"<",
"String",
",",
"TraceEvent",
">",
"events",
",",
"FileWriter",
"fw",
")",
"throws",
"Exception",
"{",
"writeString",
"(",
"fw",
",",
"\"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01 Transiti... | Write toc-mc.html for managed connections
@param events The events
@param fw The file writer
@exception Exception If an error occurs | [
"Write",
"toc",
"-",
"mc",
".",
"html",
"for",
"managed",
"connections"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/tracer/src/main/java/org/ironjacamar/tracer/HTMLReport.java#L1707-L1796 | train |
ironjacamar/ironjacamar | tracer/src/main/java/org/ironjacamar/tracer/HTMLReport.java | HTMLReport.generateToCConnectionListener | private static void generateToCConnectionListener(Map<String, List<TraceEvent>> events, FileWriter fw)
throws Exception
{
writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
writeEOL(fw);
writeString(fw, " \"http://www.w3.org/TR/html4/loos... | java | private static void generateToCConnectionListener(Map<String, List<TraceEvent>> events, FileWriter fw)
throws Exception
{
writeString(fw, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"");
writeEOL(fw);
writeString(fw, " \"http://www.w3.org/TR/html4/loos... | [
"private",
"static",
"void",
"generateToCConnectionListener",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"TraceEvent",
">",
">",
"events",
",",
"FileWriter",
"fw",
")",
"throws",
"Exception",
"{",
"writeString",
"(",
"fw",
",",
"\"<!DOCTYPE HTML PUBLIC \\\"-//W3... | Write toc-cl.html for connection listeners
@param events The events
@param fw The file writer
@exception Exception If an error occurs | [
"Write",
"toc",
"-",
"cl",
".",
"html",
"for",
"connection",
"listeners"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/tracer/src/main/java/org/ironjacamar/tracer/HTMLReport.java#L1804-L1886 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/ironjacamar/IronJacamarParser.java | IronJacamarParser.store | public void store(Activation metadata, XMLStreamWriter writer) throws Exception
{
if (metadata != null && writer != null)
{
writer.writeStartElement(XML.ELEMENT_IRONJACAMAR);
storeCommon(metadata, writer);
writer.writeEndElement();
}
} | java | public void store(Activation metadata, XMLStreamWriter writer) throws Exception
{
if (metadata != null && writer != null)
{
writer.writeStartElement(XML.ELEMENT_IRONJACAMAR);
storeCommon(metadata, writer);
writer.writeEndElement();
}
} | [
"public",
"void",
"store",
"(",
"Activation",
"metadata",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"if",
"(",
"metadata",
"!=",
"null",
"&&",
"writer",
"!=",
"null",
")",
"{",
"writer",
".",
"writeStartElement",
"(",
"XML",
".",
"... | Store an ironjacamar.xml file
@param metadata The IronJacamar definition
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"an",
"ironjacamar",
".",
"xml",
"file"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/ironjacamar/IronJacamarParser.java#L118-L126 | train |
ironjacamar/ironjacamar | validator/src/main/java/org/ironjacamar/validator/Validation.java | Validation.extract | private static File extract(File file, File directory) throws IOException
{
if (file == null)
throw new IllegalArgumentException("File is null");
if (directory == null)
throw new IllegalArgumentException("Directory is null");
File target = new File(directory, file.getName());
... | java | private static File extract(File file, File directory) throws IOException
{
if (file == null)
throw new IllegalArgumentException("File is null");
if (directory == null)
throw new IllegalArgumentException("Directory is null");
File target = new File(directory, file.getName());
... | [
"private",
"static",
"File",
"extract",
"(",
"File",
"file",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"File is null\"",
")",
";",
"if",
"(",
"directo... | Extract a JAR type file
@param file The file
@param directory The directory where the file should be extracted
@return The root of the extracted JAR file
@exception IOException Thrown if an error occurs | [
"Extract",
"a",
"JAR",
"type",
"file"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/validator/src/main/java/org/ironjacamar/validator/Validation.java#L492-L599 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/ExpressionTemplate.java | ExpressionTemplate.parse | private void parse()
{
template = text;
if (StringUtils.isEmptyTrimmed(template))
return;
int index = 0;
while (template.indexOf("${") != -1)
{
int from = template.lastIndexOf("${");
int to = template.indexOf("}", from + 2);
if (to == -1)
{
... | java | private void parse()
{
template = text;
if (StringUtils.isEmptyTrimmed(template))
return;
int index = 0;
while (template.indexOf("${") != -1)
{
int from = template.lastIndexOf("${");
int to = template.indexOf("}", from + 2);
if (to == -1)
{
... | [
"private",
"void",
"parse",
"(",
")",
"{",
"template",
"=",
"text",
";",
"if",
"(",
"StringUtils",
".",
"isEmptyTrimmed",
"(",
"template",
")",
")",
"return",
";",
"int",
"index",
"=",
"0",
";",
"while",
"(",
"template",
".",
"indexOf",
"(",
"\"${\"",
... | Parse a text and get a template and expression entities | [
"Parse",
"a",
"text",
"and",
"get",
"a",
"template",
"and",
"expression",
"entities"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/ExpressionTemplate.java#L60-L123 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/ExpressionTemplate.java | ExpressionTemplate.updateComplex | private void updateComplex(String string)
{
if (string != null && StringUtils.getExpressionKey(string) != null
&& !string.equals(StringUtils.getExpressionKey(string)))
{
complex = true;
}
} | java | private void updateComplex(String string)
{
if (string != null && StringUtils.getExpressionKey(string) != null
&& !string.equals(StringUtils.getExpressionKey(string)))
{
complex = true;
}
} | [
"private",
"void",
"updateComplex",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"!=",
"null",
"&&",
"StringUtils",
".",
"getExpressionKey",
"(",
"string",
")",
"!=",
"null",
"&&",
"!",
"string",
".",
"equals",
"(",
"StringUtils",
".",
"getExpre... | Updates the complexness of the expression based on a String value
@param string value | [
"Updates",
"the",
"complexness",
"of",
"the",
"expression",
"based",
"on",
"a",
"String",
"value"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/ExpressionTemplate.java#L129-L136 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/ExpressionTemplate.java | ExpressionTemplate.resolveTemplate | private String resolveTemplate(boolean toValue)
{
String result = template;
if (StringUtils.isEmptyTrimmed(result))
return result;
String key;
while ((key = StringUtils.getExpressionKey(result)) != null)
{
String subs;
Expression ex = entities.get(key);
... | java | private String resolveTemplate(boolean toValue)
{
String result = template;
if (StringUtils.isEmptyTrimmed(result))
return result;
String key;
while ((key = StringUtils.getExpressionKey(result)) != null)
{
String subs;
Expression ex = entities.get(key);
... | [
"private",
"String",
"resolveTemplate",
"(",
"boolean",
"toValue",
")",
"{",
"String",
"result",
"=",
"template",
";",
"if",
"(",
"StringUtils",
".",
"isEmptyTrimmed",
"(",
"result",
")",
")",
"return",
"result",
";",
"String",
"key",
";",
"while",
"(",
"(... | Resolves the template to the String value depending on boolean switch
@param toValue if equals true - all Expression entities within the template
will be presented by their values, otherwise - by their substitutions
@return resulting String | [
"Resolves",
"the",
"template",
"to",
"the",
"String",
"value",
"depending",
"on",
"boolean",
"switch"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/ExpressionTemplate.java#L184-L211 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.merge | public Connector merge(Connector connector, AnnotationRepository annotationRepository, ClassLoader classLoader)
throws Exception
{
// Process annotations
if (connector == null || (connector.getVersion() == Version.V_16 || connector.getVersion() == Version.V_17))
{
boolean isMetadataC... | java | public Connector merge(Connector connector, AnnotationRepository annotationRepository, ClassLoader classLoader)
throws Exception
{
// Process annotations
if (connector == null || (connector.getVersion() == Version.V_16 || connector.getVersion() == Version.V_17))
{
boolean isMetadataC... | [
"public",
"Connector",
"merge",
"(",
"Connector",
"connector",
",",
"AnnotationRepository",
"annotationRepository",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"Exception",
"{",
"// Process annotations",
"if",
"(",
"connector",
"==",
"null",
"||",
"(",
"connecto... | Scan for annotations in the URLs specified
@param connector The connector adapter metadata
@param annotationRepository annotationRepository to use
@param classLoader The class loader used to generate the repository
@return The updated metadata
@exception Exception Thrown if an error occurs | [
"Scan",
"for",
"annotations",
"in",
"the",
"URLs",
"specified"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L119-L149 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.hasAnnotation | private boolean hasAnnotation(Class c, Class targetClass, AnnotationRepository annotationRepository)
{
Collection<Annotation> values = annotationRepository.getAnnotation(targetClass);
if (values == null)
return false;
for (Annotation annotation : values)
{
if (annotation.get... | java | private boolean hasAnnotation(Class c, Class targetClass, AnnotationRepository annotationRepository)
{
Collection<Annotation> values = annotationRepository.getAnnotation(targetClass);
if (values == null)
return false;
for (Annotation annotation : values)
{
if (annotation.get... | [
"private",
"boolean",
"hasAnnotation",
"(",
"Class",
"c",
",",
"Class",
"targetClass",
",",
"AnnotationRepository",
"annotationRepository",
")",
"{",
"Collection",
"<",
"Annotation",
">",
"values",
"=",
"annotationRepository",
".",
"getAnnotation",
"(",
"targetClass",... | hasAnnotation, if class c contains annotation targetClass
@param c
@param targetClass
@param annotationRepository
@return | [
"hasAnnotation",
"if",
"class",
"c",
"contains",
"annotation",
"targetClass"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L915-L927 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.getConfigPropertyName | private String getConfigPropertyName(Annotation annotation)
throws ClassNotFoundException, NoSuchFieldException, NoSuchMethodException
{
if (annotation.isOnField())
{
return annotation.getMemberName();
}
else if (annotation.isOnMethod())
{
String name = annotatio... | java | private String getConfigPropertyName(Annotation annotation)
throws ClassNotFoundException, NoSuchFieldException, NoSuchMethodException
{
if (annotation.isOnField())
{
return annotation.getMemberName();
}
else if (annotation.isOnMethod())
{
String name = annotatio... | [
"private",
"String",
"getConfigPropertyName",
"(",
"Annotation",
"annotation",
")",
"throws",
"ClassNotFoundException",
",",
"NoSuchFieldException",
",",
"NoSuchMethodException",
"{",
"if",
"(",
"annotation",
".",
"isOnField",
"(",
")",
")",
"{",
"return",
"annotation... | Get the config-property-name for an annotation
@param annotation The annotation
@return The name
@exception ClassNotFoundException Thrown if a class cannot be found
@exception NoSuchFieldException Thrown if a field cannot be found
@exception NoSuchMethodException Thrown if a method cannot be found | [
"Get",
"the",
"config",
"-",
"property",
"-",
"name",
"for",
"an",
"annotation"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L1143-L1178 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.getConfigPropertyType | @SuppressWarnings("unchecked")
private String getConfigPropertyType(Annotation annotation,
Class<?> type,
ClassLoader classLoader)
throws ClassNotFoundException, ValidateException
{
if (annotation.isOnField())
{
... | java | @SuppressWarnings("unchecked")
private String getConfigPropertyType(Annotation annotation,
Class<?> type,
ClassLoader classLoader)
throws ClassNotFoundException, ValidateException
{
if (annotation.isOnField())
{
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"String",
"getConfigPropertyType",
"(",
"Annotation",
"annotation",
",",
"Class",
"<",
"?",
">",
"type",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"ClassNotFoundException",
",",
"ValidateException"... | Get the config-property-type for an annotation
@param annotation The annotation
@param type An optional declared type
@param classLoader The class loader to use
@return The fully qualified classname
@exception ClassNotFoundException Thrown if a class cannot be found
@exception ValidateException Thrown if a ConfigProper... | [
"Get",
"the",
"config",
"-",
"property",
"-",
"type",
"for",
"an",
"annotation"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L1189-L1277 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.getClasses | private Set<String> getClasses(String name, ClassLoader cl)
{
Set<String> result = new HashSet<String>();
try
{
Class<?> clz = Class.forName(name, true, cl);
while (!Object.class.equals(clz))
{
result.add(clz.getName());
clz = clz.getSupercl... | java | private Set<String> getClasses(String name, ClassLoader cl)
{
Set<String> result = new HashSet<String>();
try
{
Class<?> clz = Class.forName(name, true, cl);
while (!Object.class.equals(clz))
{
result.add(clz.getName());
clz = clz.getSupercl... | [
"private",
"Set",
"<",
"String",
">",
"getClasses",
"(",
"String",
"name",
",",
"ClassLoader",
"cl",
")",
"{",
"Set",
"<",
"String",
">",
"result",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"try",
"{",
"Class",
"<",
"?",
">",
"clz",... | Get the class names for a class and all of its super classes
@param name The name of the class
@param cl The class loader
@return The set of class names | [
"Get",
"the",
"class",
"names",
"for",
"a",
"class",
"and",
"all",
"of",
"its",
"super",
"classes"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L1285-L1304 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/annotations/Annotations.java | Annotations.hasNotNull | private boolean hasNotNull(AnnotationRepository annotationRepository, Annotation annotation)
{
Collection<Annotation> values = annotationRepository.getAnnotation(javax.validation.constraints.NotNull.class);
if (values == null || values.isEmpty())
return false;
for (Annotation notNullAnno... | java | private boolean hasNotNull(AnnotationRepository annotationRepository, Annotation annotation)
{
Collection<Annotation> values = annotationRepository.getAnnotation(javax.validation.constraints.NotNull.class);
if (values == null || values.isEmpty())
return false;
for (Annotation notNullAnno... | [
"private",
"boolean",
"hasNotNull",
"(",
"AnnotationRepository",
"annotationRepository",
",",
"Annotation",
"annotation",
")",
"{",
"Collection",
"<",
"Annotation",
">",
"values",
"=",
"annotationRepository",
".",
"getAnnotation",
"(",
"javax",
".",
"validation",
".",... | Has a NotNull annotation attached
@param annotationRepository The annotation repository
@param annotation The annotation being checked
@return True of the method/field contains the NotNull annotation; otherwise false | [
"Has",
"a",
"NotNull",
"annotation",
"attached"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/annotations/Annotations.java#L1312-L1327 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java | AbstractManagedConnectionPool.validateConnectionListener | protected ConnectionListener validateConnectionListener(Collection<ConnectionListener> listeners,
ConnectionListener cl,
int newState)
{
ManagedConnectionFactory mcf = pool.getConnectionManager... | java | protected ConnectionListener validateConnectionListener(Collection<ConnectionListener> listeners,
ConnectionListener cl,
int newState)
{
ManagedConnectionFactory mcf = pool.getConnectionManager... | [
"protected",
"ConnectionListener",
"validateConnectionListener",
"(",
"Collection",
"<",
"ConnectionListener",
">",
"listeners",
",",
"ConnectionListener",
"cl",
",",
"int",
"newState",
")",
"{",
"ManagedConnectionFactory",
"mcf",
"=",
"pool",
".",
"getConnectionManager",... | Validate a connection listener
@param listeners The listeners
@param cl The connection listener
@param newState The new state
@return The validated connection listener, or <code>null</code> if validation failed | [
"Validate",
"a",
"connection",
"listener"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java#L93-L158 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java | AbstractManagedConnectionPool.destroyAndRemoveConnectionListener | protected void destroyAndRemoveConnectionListener(ConnectionListener cl, Collection<ConnectionListener> listeners)
{
try
{
pool.destroyConnectionListener(cl);
}
catch (ResourceException e)
{
// TODO:
cl.setState(ZOMBIE);
}
finally
{
... | java | protected void destroyAndRemoveConnectionListener(ConnectionListener cl, Collection<ConnectionListener> listeners)
{
try
{
pool.destroyConnectionListener(cl);
}
catch (ResourceException e)
{
// TODO:
cl.setState(ZOMBIE);
}
finally
{
... | [
"protected",
"void",
"destroyAndRemoveConnectionListener",
"(",
"ConnectionListener",
"cl",
",",
"Collection",
"<",
"ConnectionListener",
">",
"listeners",
")",
"{",
"try",
"{",
"pool",
".",
"destroyConnectionListener",
"(",
"cl",
")",
";",
"}",
"catch",
"(",
"Res... | Destroy and remove a connection listener
@param cl The connection listener
@param listeners The listeners | [
"Destroy",
"and",
"remove",
"a",
"connection",
"listener"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java#L165-L180 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java | AbstractManagedConnectionPool.findConnectionListener | protected ConnectionListener findConnectionListener(ManagedConnection mc, Object c,
Collection<ConnectionListener> listeners)
{
for (ConnectionListener cl : listeners)
{
if (cl.getManagedConnection().equals(mc) && (c == null || cl.getConnect... | java | protected ConnectionListener findConnectionListener(ManagedConnection mc, Object c,
Collection<ConnectionListener> listeners)
{
for (ConnectionListener cl : listeners)
{
if (cl.getManagedConnection().equals(mc) && (c == null || cl.getConnect... | [
"protected",
"ConnectionListener",
"findConnectionListener",
"(",
"ManagedConnection",
"mc",
",",
"Object",
"c",
",",
"Collection",
"<",
"ConnectionListener",
">",
"listeners",
")",
"{",
"for",
"(",
"ConnectionListener",
"cl",
":",
"listeners",
")",
"{",
"if",
"("... | Find a ConnectionListener instance
@param mc The associated ManagedConnection
@param c The connection (optional)
@param listeners The listeners
@return The ConnectionListener, or <code>null</code> | [
"Find",
"a",
"ConnectionListener",
"instance"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java#L189-L199 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java | AbstractManagedConnectionPool.removeConnectionListener | protected ConnectionListener removeConnectionListener(boolean free, Collection<ConnectionListener> listeners)
{
if (free)
{
for (ConnectionListener cl : listeners)
{
if (cl.changeState(FREE, IN_USE))
return cl;
}
}
else
{
fo... | java | protected ConnectionListener removeConnectionListener(boolean free, Collection<ConnectionListener> listeners)
{
if (free)
{
for (ConnectionListener cl : listeners)
{
if (cl.changeState(FREE, IN_USE))
return cl;
}
}
else
{
fo... | [
"protected",
"ConnectionListener",
"removeConnectionListener",
"(",
"boolean",
"free",
",",
"Collection",
"<",
"ConnectionListener",
">",
"listeners",
")",
"{",
"if",
"(",
"free",
")",
"{",
"for",
"(",
"ConnectionListener",
"cl",
":",
"listeners",
")",
"{",
"if"... | Remove a free ConnectionListener instance
@param free True if FREE, false if IN_USE
@param listeners The listeners
@return The ConnectionListener, or <code>null</code> | [
"Remove",
"a",
"free",
"ConnectionListener",
"instance"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/connectionmanager/pool/AbstractManagedConnectionPool.java#L207-L227 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/MetadataFactory.java | MetadataFactory.getStandardMetaData | public Connector getStandardMetaData(File root) throws Exception
{
Connector result = null;
File metadataFile = new File(root, "/META-INF/ra.xml");
if (metadataFile.exists())
{
InputStream input = null;
String url = metadataFile.getAbsolutePath();
try
{
... | java | public Connector getStandardMetaData(File root) throws Exception
{
Connector result = null;
File metadataFile = new File(root, "/META-INF/ra.xml");
if (metadataFile.exists())
{
InputStream input = null;
String url = metadataFile.getAbsolutePath();
try
{
... | [
"public",
"Connector",
"getStandardMetaData",
"(",
"File",
"root",
")",
"throws",
"Exception",
"{",
"Connector",
"result",
"=",
"null",
";",
"File",
"metadataFile",
"=",
"new",
"File",
"(",
"root",
",",
"\"/META-INF/ra.xml\"",
")",
";",
"if",
"(",
"metadataFil... | Get the JCA standard metadata
@param root The root of the deployment
@return The metadata
@exception Exception Thrown if an error occurs | [
"Get",
"the",
"JCA",
"standard",
"metadata"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/MetadataFactory.java#L62-L100 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/MetadataFactory.java | MetadataFactory.getIronJacamarMetaData | public Activation getIronJacamarMetaData(File root) throws Exception
{
Activation result = null;
File metadataFile = new File(root, "/META-INF/ironjacamar.xml");
if (metadataFile.exists())
{
InputStream input = null;
String url = metadataFile.getAbsolutePath();
tr... | java | public Activation getIronJacamarMetaData(File root) throws Exception
{
Activation result = null;
File metadataFile = new File(root, "/META-INF/ironjacamar.xml");
if (metadataFile.exists())
{
InputStream input = null;
String url = metadataFile.getAbsolutePath();
tr... | [
"public",
"Activation",
"getIronJacamarMetaData",
"(",
"File",
"root",
")",
"throws",
"Exception",
"{",
"Activation",
"result",
"=",
"null",
";",
"File",
"metadataFile",
"=",
"new",
"File",
"(",
"root",
",",
"\"/META-INF/ironjacamar.xml\"",
")",
";",
"if",
"(",
... | Get the IronJacamar specific metadata
@param root The root of the deployment
@return The metadata
@exception Exception Thrown if an error occurs | [
"Get",
"the",
"IronJacamar",
"specific",
"metadata"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/MetadataFactory.java#L108-L143 | train |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/spec/OutboundResourceAdapterImpl.java | OutboundResourceAdapterImpl.forceConnectionDefinitions | public synchronized void forceConnectionDefinitions(List<ConnectionDefinition> newContent)
{
if (newContent != null)
{
this.connectionDefinition = new ArrayList<ConnectionDefinition>(newContent);
}
else
{
this.connectionDefinition = new ArrayList<ConnectionDefinition>(... | java | public synchronized void forceConnectionDefinitions(List<ConnectionDefinition> newContent)
{
if (newContent != null)
{
this.connectionDefinition = new ArrayList<ConnectionDefinition>(newContent);
}
else
{
this.connectionDefinition = new ArrayList<ConnectionDefinition>(... | [
"public",
"synchronized",
"void",
"forceConnectionDefinitions",
"(",
"List",
"<",
"ConnectionDefinition",
">",
"newContent",
")",
"{",
"if",
"(",
"newContent",
"!=",
"null",
")",
"{",
"this",
".",
"connectionDefinition",
"=",
"new",
"ArrayList",
"<",
"ConnectionDe... | Force connectionDefinition with new content.
This method is thread safe
@param newContent the list of new properties | [
"Force",
"connectionDefinition",
"with",
"new",
"content",
".",
"This",
"method",
"is",
"thread",
"safe"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/spec/OutboundResourceAdapterImpl.java#L113-L123 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/security/SecurityActions.java | SecurityActions.getResourceAsStream | static InputStream getResourceAsStream(final String name)
{
if (System.getSecurityManager() == null)
return Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
return AccessController.doPrivileged(new PrivilegedAction<InputStream>()
{
public InputStream run... | java | static InputStream getResourceAsStream(final String name)
{
if (System.getSecurityManager() == null)
return Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
return AccessController.doPrivileged(new PrivilegedAction<InputStream>()
{
public InputStream run... | [
"static",
"InputStream",
"getResourceAsStream",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"return",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
... | Get the input stream for a resource in the context class loader
@param name The name of the resource
@return The input stream | [
"Get",
"the",
"input",
"stream",
"for",
"a",
"resource",
"in",
"the",
"context",
"class",
"loader"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/security/SecurityActions.java#L46-L58 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/jgroups/SecurityActions.java | SecurityActions.createWorkClassLoader | static WorkClassLoader createWorkClassLoader(final ClassBundle cb)
{
return AccessController.doPrivileged(new PrivilegedAction<WorkClassLoader>()
{
public WorkClassLoader run()
{
return new WorkClassLoader(cb);
}
});
} | java | static WorkClassLoader createWorkClassLoader(final ClassBundle cb)
{
return AccessController.doPrivileged(new PrivilegedAction<WorkClassLoader>()
{
public WorkClassLoader run()
{
return new WorkClassLoader(cb);
}
});
} | [
"static",
"WorkClassLoader",
"createWorkClassLoader",
"(",
"final",
"ClassBundle",
"cb",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"WorkClassLoader",
">",
"(",
")",
"{",
"public",
"WorkClassLoader",
"run",
"(",... | Create a WorkClassLoader
@param cb The class bundle
@return The class loader | [
"Create",
"a",
"WorkClassLoader"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/transport/remote/jgroups/SecurityActions.java#L65-L74 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/tracer/TraceEvent.java | TraceEvent.parse | public static TraceEvent parse(String data)
{
String[] raw = data.split("-");
String header = raw[0];
String p = raw[1];
String m = raw[2];
long tid = Long.parseLong(raw[3]);
int t = Integer.parseInt(raw[4]);
long ts = Long.parseLong(raw[5]);
String c = raw[6];
... | java | public static TraceEvent parse(String data)
{
String[] raw = data.split("-");
String header = raw[0];
String p = raw[1];
String m = raw[2];
long tid = Long.parseLong(raw[3]);
int t = Integer.parseInt(raw[4]);
long ts = Long.parseLong(raw[5]);
String c = raw[6];
... | [
"public",
"static",
"TraceEvent",
"parse",
"(",
"String",
"data",
")",
"{",
"String",
"[",
"]",
"raw",
"=",
"data",
".",
"split",
"(",
"\"-\"",
")",
";",
"String",
"header",
"=",
"raw",
"[",
"0",
"]",
";",
"String",
"p",
"=",
"raw",
"[",
"1",
"]"... | Parse a trace event
@param data The data string
@return The event | [
"Parse",
"a",
"trace",
"event"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/tracer/TraceEvent.java#L453-L473 | train |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/ConnMetaCodeGen.java | ConnMetaCodeGen.writeEIS | private void writeEIS(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Returns product name of the underlying EIS instance connected\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * ... | java | private void writeEIS(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Returns product name of the underlying EIS instance connected\n");
writeWithIndent(out, indent, " *\n");
writeWithIndent(out, indent, " * ... | [
"private",
"void",
"writeEIS",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"indent",
... | Output eis info method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"eis",
"info",
"method"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/ConnMetaCodeGen.java#L94-L123 | train |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/bv/BeanValidationImpl.java | BeanValidationImpl.createValidatorFactory | static ValidatorFactory createValidatorFactory()
{
Configuration configuration = Validation.byDefaultProvider().configure();
Configuration<?> conf = configuration.traversableResolver(new IronJacamarTraversableResolver());
return conf.buildValidatorFactory();
} | java | static ValidatorFactory createValidatorFactory()
{
Configuration configuration = Validation.byDefaultProvider().configure();
Configuration<?> conf = configuration.traversableResolver(new IronJacamarTraversableResolver());
return conf.buildValidatorFactory();
} | [
"static",
"ValidatorFactory",
"createValidatorFactory",
"(",
")",
"{",
"Configuration",
"configuration",
"=",
"Validation",
".",
"byDefaultProvider",
"(",
")",
".",
"configure",
"(",
")",
";",
"Configuration",
"<",
"?",
">",
"conf",
"=",
"configuration",
".",
"t... | Create a validator factory
@return The factory | [
"Create",
"a",
"validator",
"factory"
] | f0389ee7e62aa8b40ba09b251edad76d220ea796 | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/bv/BeanValidationImpl.java#L81-L87 | train |
Backendless/Android-SDK | src/com/backendless/persistence/PagedQueryBuilder.java | PagedQueryBuilder.prepareNextPage | Builder prepareNextPage()
{
int offset = this.offset + pageSize;
validateOffset( offset );
this.offset = offset;
return builder;
} | java | Builder prepareNextPage()
{
int offset = this.offset + pageSize;
validateOffset( offset );
this.offset = offset;
return builder;
} | [
"Builder",
"prepareNextPage",
"(",
")",
"{",
"int",
"offset",
"=",
"this",
".",
"offset",
"+",
"pageSize",
";",
"validateOffset",
"(",
"offset",
")",
";",
"this",
".",
"offset",
"=",
"offset",
";",
"return",
"builder",
";",
"}"
] | Updates offset to point at next data page by adding pageSize. | [
"Updates",
"offset",
"to",
"point",
"at",
"next",
"data",
"page",
"by",
"adding",
"pageSize",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/PagedQueryBuilder.java#L36-L43 | train |
Backendless/Android-SDK | src/com/backendless/persistence/PagedQueryBuilder.java | PagedQueryBuilder.preparePreviousPage | Builder preparePreviousPage()
{
int offset = this.offset - pageSize;
validateOffset( offset );
this.offset = offset;
return builder;
} | java | Builder preparePreviousPage()
{
int offset = this.offset - pageSize;
validateOffset( offset );
this.offset = offset;
return builder;
} | [
"Builder",
"preparePreviousPage",
"(",
")",
"{",
"int",
"offset",
"=",
"this",
".",
"offset",
"-",
"pageSize",
";",
"validateOffset",
"(",
"offset",
")",
";",
"this",
".",
"offset",
"=",
"offset",
";",
"return",
"builder",
";",
"}"
] | Updates offset to point at previous data page by subtracting pageSize. | [
"Updates",
"offset",
"to",
"point",
"at",
"previous",
"data",
"page",
"by",
"subtracting",
"pageSize",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/PagedQueryBuilder.java#L48-L55 | train |
Backendless/Android-SDK | samples/UserService/userservicedemo/src/com/backendless/examples/userservice/demo/DefaultCallback.java | DefaultCallback.handleFault | @Override
public void handleFault( BackendlessFault fault )
{
progressDialog.cancel();
Toast.makeText( context, fault.getMessage(), Toast.LENGTH_SHORT ).show();
} | java | @Override
public void handleFault( BackendlessFault fault )
{
progressDialog.cancel();
Toast.makeText( context, fault.getMessage(), Toast.LENGTH_SHORT ).show();
} | [
"@",
"Override",
"public",
"void",
"handleFault",
"(",
"BackendlessFault",
"fault",
")",
"{",
"progressDialog",
".",
"cancel",
"(",
")",
";",
"Toast",
".",
"makeText",
"(",
"context",
",",
"fault",
".",
"getMessage",
"(",
")",
",",
"Toast",
".",
"LENGTH_SH... | This override is optional | [
"This",
"override",
"is",
"optional"
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/samples/UserService/userservicedemo/src/com/backendless/examples/userservice/demo/DefaultCallback.java#L45-L50 | train |
Backendless/Android-SDK | src/com/backendless/persistence/BackendlessSerializer.java | BackendlessSerializer.serializeToMap | public static Map<String, Object> serializeToMap( Object entity )
{
IObjectSerializer serializer = getSerializer( entity.getClass() );
return (Map<String, Object>) serializer.serializeToMap( entity, new HashMap<Object, Map<String, Object>>() );
} | java | public static Map<String, Object> serializeToMap( Object entity )
{
IObjectSerializer serializer = getSerializer( entity.getClass() );
return (Map<String, Object>) serializer.serializeToMap( entity, new HashMap<Object, Map<String, Object>>() );
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"serializeToMap",
"(",
"Object",
"entity",
")",
"{",
"IObjectSerializer",
"serializer",
"=",
"getSerializer",
"(",
"entity",
".",
"getClass",
"(",
")",
")",
";",
"return",
"(",
"Map",
"<",
"Stri... | Serializes Object to Map using WebOrb's serializer.
@param entity object to be serialized
@return Map corresponding to given Object | [
"Serializes",
"Object",
"to",
"Map",
"using",
"WebOrb",
"s",
"serializer",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/BackendlessSerializer.java#L53-L57 | train |
Backendless/Android-SDK | src/com/backendless/persistence/BackendlessSerializer.java | BackendlessSerializer.getSimpleName | public static String getSimpleName( Class clazz )
{
IObjectSerializer serializer = getSerializer( clazz );
return serializer.getClassName( clazz );
} | java | public static String getSimpleName( Class clazz )
{
IObjectSerializer serializer = getSerializer( clazz );
return serializer.getClassName( clazz );
} | [
"public",
"static",
"String",
"getSimpleName",
"(",
"Class",
"clazz",
")",
"{",
"IObjectSerializer",
"serializer",
"=",
"getSerializer",
"(",
"clazz",
")",
";",
"return",
"serializer",
".",
"getClassName",
"(",
"clazz",
")",
";",
"}"
] | Uses pluggable serializers to locate one for the class and get the name which should be used for serialization.
The name must match the table name where instance of clazz are persisted
@param clazz
@return Backendless-friendly class/table name | [
"Uses",
"pluggable",
"serializers",
"to",
"locate",
"one",
"for",
"the",
"class",
"and",
"get",
"the",
"name",
"which",
"should",
"be",
"used",
"for",
"serialization",
".",
"The",
"name",
"must",
"match",
"the",
"table",
"name",
"where",
"instance",
"of",
... | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/BackendlessSerializer.java#L66-L70 | train |
Backendless/Android-SDK | src/com/backendless/persistence/BackendlessSerializer.java | BackendlessSerializer.getOrMakeSerializedObject | private Object getOrMakeSerializedObject( Object entityEntryValue,
Map<Object, Map<String, Object>> serializedCache )
{
if( serializedCache.containsKey( entityEntryValue ) ) //cyclic relation
{
//take from cache and substitute
return serializedCac... | java | private Object getOrMakeSerializedObject( Object entityEntryValue,
Map<Object, Map<String, Object>> serializedCache )
{
if( serializedCache.containsKey( entityEntryValue ) ) //cyclic relation
{
//take from cache and substitute
return serializedCac... | [
"private",
"Object",
"getOrMakeSerializedObject",
"(",
"Object",
"entityEntryValue",
",",
"Map",
"<",
"Object",
",",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"serializedCache",
")",
"{",
"if",
"(",
"serializedCache",
".",
"containsKey",
"(",
"entityEntryVa... | Returns serialized object from cache or serializes object if it's not present in cache.
@param entityEntryValue object to be serialized
@return Map formed from given object | [
"Returns",
"serialized",
"object",
"from",
"cache",
"or",
"serializes",
"object",
"if",
"it",
"s",
"not",
"present",
"in",
"cache",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/BackendlessSerializer.java#L214-L227 | train |
Backendless/Android-SDK | src/com/backendless/persistence/BackendlessSerializer.java | BackendlessSerializer.serializeUserProperties | public static void serializeUserProperties( BackendlessUser user )
{
Map<String, Object> serializedProperties = user.getProperties();
Set<Map.Entry<String, Object>> properties = serializedProperties.entrySet();
for( Map.Entry<String, Object> property : properties )
{
Object propertyValue = prop... | java | public static void serializeUserProperties( BackendlessUser user )
{
Map<String, Object> serializedProperties = user.getProperties();
Set<Map.Entry<String, Object>> properties = serializedProperties.entrySet();
for( Map.Entry<String, Object> property : properties )
{
Object propertyValue = prop... | [
"public",
"static",
"void",
"serializeUserProperties",
"(",
"BackendlessUser",
"user",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"serializedProperties",
"=",
"user",
".",
"getProperties",
"(",
")",
";",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"String... | Serializes entities inside BackendlessUser properties.
@param user BackendlessUser whose properties need to be serialized | [
"Serializes",
"entities",
"inside",
"BackendlessUser",
"properties",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/BackendlessSerializer.java#L234-L249 | train |
Backendless/Android-SDK | src/com/backendless/persistence/BackendlessSerializer.java | BackendlessSerializer.getSerializer | private static IObjectSerializer getSerializer( Class clazz )
{
Iterator<Map.Entry<Class, IObjectSerializer>> iterator = serializers.entrySet().iterator();
IObjectSerializer serializer = DEFAULT_SERIALIZER;
while( iterator.hasNext() )
{
Map.Entry<Class, IObjectSerializer> entry = iterator.next(... | java | private static IObjectSerializer getSerializer( Class clazz )
{
Iterator<Map.Entry<Class, IObjectSerializer>> iterator = serializers.entrySet().iterator();
IObjectSerializer serializer = DEFAULT_SERIALIZER;
while( iterator.hasNext() )
{
Map.Entry<Class, IObjectSerializer> entry = iterator.next(... | [
"private",
"static",
"IObjectSerializer",
"getSerializer",
"(",
"Class",
"clazz",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"Class",
",",
"IObjectSerializer",
">",
">",
"iterator",
"=",
"serializers",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(... | Returns a serializer for the class
@param clazz
@return | [
"Returns",
"a",
"serializer",
"for",
"the",
"class"
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/persistence/BackendlessSerializer.java#L268-L285 | train |
Backendless/Android-SDK | src/com/backendless/UserService.java | UserService.setCurrentUser | public void setCurrentUser( BackendlessUser user )
{
if( currentUser == null )
currentUser = user;
else
currentUser.setProperties( user.getProperties() );
} | java | public void setCurrentUser( BackendlessUser user )
{
if( currentUser == null )
currentUser = user;
else
currentUser.setProperties( user.getProperties() );
} | [
"public",
"void",
"setCurrentUser",
"(",
"BackendlessUser",
"user",
")",
"{",
"if",
"(",
"currentUser",
"==",
"null",
")",
"currentUser",
"=",
"user",
";",
"else",
"currentUser",
".",
"setProperties",
"(",
"user",
".",
"getProperties",
"(",
")",
")",
";",
... | Sets the properties of the given user to current one.
@param user a user from which properties should be taken | [
"Sets",
"the",
"properties",
"of",
"the",
"given",
"user",
"to",
"current",
"one",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/UserService.java#L803-L809 | train |
Backendless/Android-SDK | src/com/backendless/Messaging.java | Messaging.publish | public MessageStatus publish( String channelName, Object message )
{
return publish( channelName, message, new PublishOptions() );
} | java | public MessageStatus publish( String channelName, Object message )
{
return publish( channelName, message, new PublishOptions() );
} | [
"public",
"MessageStatus",
"publish",
"(",
"String",
"channelName",
",",
"Object",
"message",
")",
"{",
"return",
"publish",
"(",
"channelName",
",",
"message",
",",
"new",
"PublishOptions",
"(",
")",
")",
";",
"}"
] | Publishes message to specified channel. The message is not a push notification, it does not have any headers and
does not go into any subtopics.
@param channelName name of a channel to publish the message to. If the channel does not exist, Backendless
automatically creates it.
@param message object to publish. The... | [
"Publishes",
"message",
"to",
"specified",
"channel",
".",
"The",
"message",
"is",
"not",
"a",
"push",
"notification",
"it",
"does",
"not",
"have",
"any",
"headers",
"and",
"does",
"not",
"go",
"into",
"any",
"subtopics",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/Messaging.java#L288-L291 | train |
Backendless/Android-SDK | src/com/backendless/utils/ReflectionUtil.java | ReflectionUtil.getFieldValue | public static Object getFieldValue( Object object, String lowerKey, String upperKey ) //throws NoSuchFieldException
{
if( object == null )
return null;
Method getMethod = getMethod( object, "get" + lowerKey );
if( getMethod == null )
getMethod = getMethod( object, "get" + upperKey );
if... | java | public static Object getFieldValue( Object object, String lowerKey, String upperKey ) //throws NoSuchFieldException
{
if( object == null )
return null;
Method getMethod = getMethod( object, "get" + lowerKey );
if( getMethod == null )
getMethod = getMethod( object, "get" + upperKey );
if... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"object",
",",
"String",
"lowerKey",
",",
"String",
"upperKey",
")",
"//throws NoSuchFieldException",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"return",
"null",
";",
"Method",
"getMethod",
"=",
... | Retrieves the value of the field with given name from the given object.
@param object object containing the field
@param lowerKey name of the field starting with lower case letter
@param upperKey name of the field starting with the upper case letter
@return Object, which is the value of the given field in the given ... | [
"Retrieves",
"the",
"value",
"of",
"the",
"field",
"with",
"given",
"name",
"from",
"the",
"given",
"object",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/utils/ReflectionUtil.java#L40-L93 | train |
Backendless/Android-SDK | src/com/backendless/utils/ReflectionUtil.java | ReflectionUtil.hasField | public static boolean hasField( Class clazz, String fieldName )
{
try
{
clazz.getDeclaredField( fieldName );
return true;
}
catch( NoSuchFieldException nfe )
{
if( clazz.getSuperclass() != null )
{
return hasField( clazz.getSuperclass(), fieldName );
}
e... | java | public static boolean hasField( Class clazz, String fieldName )
{
try
{
clazz.getDeclaredField( fieldName );
return true;
}
catch( NoSuchFieldException nfe )
{
if( clazz.getSuperclass() != null )
{
return hasField( clazz.getSuperclass(), fieldName );
}
e... | [
"public",
"static",
"boolean",
"hasField",
"(",
"Class",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"clazz",
".",
"getDeclaredField",
"(",
"fieldName",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"NoSuchFieldException",
"nfe",
")",
... | Checks whether given class contains a field with given name.
Recursively checks superclasses.
@param clazz Class in which to search for a field
@param fieldName name of the field
@return {@code true} if given class or one of its superclasses contains field with given name, else {@code false} | [
"Checks",
"whether",
"given",
"class",
"contains",
"a",
"field",
"with",
"given",
"name",
".",
"Recursively",
"checks",
"superclasses",
"."
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/utils/ReflectionUtil.java#L142-L160 | train |
Backendless/Android-SDK | src/com/backendless/servercode/extension/FilesExtender.java | FilesExtender.afterMoveToRepository | @Deprecated
public void afterMoveToRepository( RunnerContext context, String fileUrlLocation, ExecutionResult<String> result ) throws Exception
{
} | java | @Deprecated
public void afterMoveToRepository( RunnerContext context, String fileUrlLocation, ExecutionResult<String> result ) throws Exception
{
} | [
"@",
"Deprecated",
"public",
"void",
"afterMoveToRepository",
"(",
"RunnerContext",
"context",
",",
"String",
"fileUrlLocation",
",",
"ExecutionResult",
"<",
"String",
">",
"result",
")",
"throws",
"Exception",
"{",
"}"
] | Use afterUpload method
@param context
@param fileUrlLocation
@param result
@throws Exception | [
"Use",
"afterUpload",
"method"
] | 3af1e9a378f19d890db28a833f7fc8595b924cc3 | https://github.com/Backendless/Android-SDK/blob/3af1e9a378f19d890db28a833f7fc8595b924cc3/src/com/backendless/servercode/extension/FilesExtender.java#L54-L57 | train |
shapesecurity/shape-functional-java | src/main/java/com/shapesecurity/functional/data/ImmutableSet.java | ImmutableSet.toList | @Nonnull
public ImmutableList<T> toList() {
return this.foldAbelian((v, acc) -> acc.cons(v), ImmutableList.empty());
} | java | @Nonnull
public ImmutableList<T> toList() {
return this.foldAbelian((v, acc) -> acc.cons(v), ImmutableList.empty());
} | [
"@",
"Nonnull",
"public",
"ImmutableList",
"<",
"T",
">",
"toList",
"(",
")",
"{",
"return",
"this",
".",
"foldAbelian",
"(",
"(",
"v",
",",
"acc",
")",
"->",
"acc",
".",
"cons",
"(",
"v",
")",
",",
"ImmutableList",
".",
"empty",
"(",
")",
")",
"... | Does not guarantee ordering of elements in resulting list. | [
"Does",
"not",
"guarantee",
"ordering",
"of",
"elements",
"in",
"resulting",
"list",
"."
] | 02edea5a901b8603f6a852478ec009857fa012d6 | https://github.com/shapesecurity/shape-functional-java/blob/02edea5a901b8603f6a852478ec009857fa012d6/src/main/java/com/shapesecurity/functional/data/ImmutableSet.java#L146-L149 | train |
eclecticlogic/pedal-dialect | src/main/java/com/eclecticlogic/pedal/provider/hibernate/ArrayType.java | ArrayType.setArrayValue | protected void setArrayValue(final PreparedStatement statement, final int i, Connection connection, Object[] array)
throws SQLException {
if (array == null || (isEmptyStoredAsNull() && array.length == 0)) {
statement.setNull(i, Types.ARRAY);
} else {
statement.setArra... | java | protected void setArrayValue(final PreparedStatement statement, final int i, Connection connection, Object[] array)
throws SQLException {
if (array == null || (isEmptyStoredAsNull() && array.length == 0)) {
statement.setNull(i, Types.ARRAY);
} else {
statement.setArra... | [
"protected",
"void",
"setArrayValue",
"(",
"final",
"PreparedStatement",
"statement",
",",
"final",
"int",
"i",
",",
"Connection",
"connection",
",",
"Object",
"[",
"]",
"array",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"array",
"==",
"null",
"||",
"("... | Stores the array conforming to the EMPTY_IS_NULL directive.
@see org.hibernate.usertype.UserType#nullSafeSet(java.sql.PreparedStatement, java.lang.Object, int, org.hibernate.engine.spi.SessionImplementor) | [
"Stores",
"the",
"array",
"conforming",
"to",
"the",
"EMPTY_IS_NULL",
"directive",
"."
] | d92ccff34ef2363ce0db7ae4976302833182115b | https://github.com/eclecticlogic/pedal-dialect/blob/d92ccff34ef2363ce0db7ae4976302833182115b/src/main/java/com/eclecticlogic/pedal/provider/hibernate/ArrayType.java#L64-L71 | train |
shapesecurity/shape-functional-java | src/main/java/com/shapesecurity/functional/data/ImmutableList.java | ImmutableList.toArrayList | @Nonnull
public final ArrayList<A> toArrayList() {
ArrayList<A> list = new ArrayList<>(this.length);
ImmutableList<A> l = this;
for (int i = 0; i < length; i++) {
list.add(((NonEmptyImmutableList<A>) l).head);
l = ((NonEmptyImmutableList<A>) l).tail;
}
... | java | @Nonnull
public final ArrayList<A> toArrayList() {
ArrayList<A> list = new ArrayList<>(this.length);
ImmutableList<A> l = this;
for (int i = 0; i < length; i++) {
list.add(((NonEmptyImmutableList<A>) l).head);
l = ((NonEmptyImmutableList<A>) l).tail;
}
... | [
"@",
"Nonnull",
"public",
"final",
"ArrayList",
"<",
"A",
">",
"toArrayList",
"(",
")",
"{",
"ArrayList",
"<",
"A",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
"this",
".",
"length",
")",
";",
"ImmutableList",
"<",
"A",
">",
"l",
"=",
"this",
... | Converts this list into a java.util.ArrayList.
@return The list that contains the elements. | [
"Converts",
"this",
"list",
"into",
"a",
"java",
".",
"util",
".",
"ArrayList",
"."
] | 02edea5a901b8603f6a852478ec009857fa012d6 | https://github.com/shapesecurity/shape-functional-java/blob/02edea5a901b8603f6a852478ec009857fa012d6/src/main/java/com/shapesecurity/functional/data/ImmutableList.java#L487-L496 | train |
shapesecurity/shape-functional-java | src/main/java/com/shapesecurity/functional/data/ImmutableList.java | ImmutableList.toLinkedList | @Nonnull
public final LinkedList<A> toLinkedList() {
LinkedList<A> list = new LinkedList<>();
ImmutableList<A> l = this;
for (int i = 0; i < length; i++) {
list.add(((NonEmptyImmutableList<A>) l).head);
l = ((NonEmptyImmutableList<A>) l).tail;
}
return... | java | @Nonnull
public final LinkedList<A> toLinkedList() {
LinkedList<A> list = new LinkedList<>();
ImmutableList<A> l = this;
for (int i = 0; i < length; i++) {
list.add(((NonEmptyImmutableList<A>) l).head);
l = ((NonEmptyImmutableList<A>) l).tail;
}
return... | [
"@",
"Nonnull",
"public",
"final",
"LinkedList",
"<",
"A",
">",
"toLinkedList",
"(",
")",
"{",
"LinkedList",
"<",
"A",
">",
"list",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"ImmutableList",
"<",
"A",
">",
"l",
"=",
"this",
";",
"for",
"(",
"i... | Converts this list into a java.util.LinkedList.
@return The list that contains the elements. | [
"Converts",
"this",
"list",
"into",
"a",
"java",
".",
"util",
".",
"LinkedList",
"."
] | 02edea5a901b8603f6a852478ec009857fa012d6 | https://github.com/shapesecurity/shape-functional-java/blob/02edea5a901b8603f6a852478ec009857fa012d6/src/main/java/com/shapesecurity/functional/data/ImmutableList.java#L503-L512 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/client/AAFClient.java | AAFClient.read | public<T> Get<T> read(Class<T> cls) throws APIException {
return new Get<T>(this,getDF(cls));
} | java | public<T> Get<T> read(Class<T> cls) throws APIException {
return new Get<T>(this,getDF(cls));
} | [
"public",
"<",
"T",
">",
"Get",
"<",
"T",
">",
"read",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"APIException",
"{",
"return",
"new",
"Get",
"<",
"T",
">",
"(",
"this",
",",
"getDF",
"(",
"cls",
")",
")",
";",
"}"
] | Returns a Get Object... same as "get"
@param cls
@return
@throws APIException | [
"Returns",
"a",
"Get",
"Object",
"...",
"same",
"as",
"get"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/client/AAFClient.java#L93-L95 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/client/AAFClient.java | AAFClient.get | public<T> Get<T> get(Class<T> cls) throws APIException {
return new Get<T>(this,getDF(cls));
} | java | public<T> Get<T> get(Class<T> cls) throws APIException {
return new Get<T>(this,getDF(cls));
} | [
"public",
"<",
"T",
">",
"Get",
"<",
"T",
">",
"get",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"APIException",
"{",
"return",
"new",
"Get",
"<",
"T",
">",
"(",
"this",
",",
"getDF",
"(",
"cls",
")",
")",
";",
"}"
] | Returns a Get Object... same as "read"
@param cls
@return
@throws APIException | [
"Returns",
"a",
"Get",
"Object",
"...",
"same",
"as",
"read"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/client/AAFClient.java#L104-L106 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/client/AAFClient.java | AAFClient.post | public<T> Post<T> post(Class<T> cls) throws APIException {
return new Post<T>(this,getDF(cls));
} | java | public<T> Post<T> post(Class<T> cls) throws APIException {
return new Post<T>(this,getDF(cls));
} | [
"public",
"<",
"T",
">",
"Post",
"<",
"T",
">",
"post",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"APIException",
"{",
"return",
"new",
"Post",
"<",
"T",
">",
"(",
"this",
",",
"getDF",
"(",
"cls",
")",
")",
";",
"}"
] | Returns a Post Object... same as "create"
@param cls
@return
@throws APIException | [
"Returns",
"a",
"Post",
"Object",
"...",
"same",
"as",
"create"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/client/AAFClient.java#L115-L117 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/client/AAFClient.java | AAFClient.create | public<T> Post<T> create(Class<T> cls) throws APIException {
return new Post<T>(this,getDF(cls));
} | java | public<T> Post<T> create(Class<T> cls) throws APIException {
return new Post<T>(this,getDF(cls));
} | [
"public",
"<",
"T",
">",
"Post",
"<",
"T",
">",
"create",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"APIException",
"{",
"return",
"new",
"Post",
"<",
"T",
">",
"(",
"this",
",",
"getDF",
"(",
"cls",
")",
")",
";",
"}"
] | Returns a Post Object... same as "post"
@param cls
@return
@throws APIException | [
"Returns",
"a",
"Post",
"Object",
"...",
"same",
"as",
"post"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/client/AAFClient.java#L126-L128 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/client/AAFClient.java | AAFClient.put | public<T> Put<T> put(Class<T> cls) throws APIException {
return new Put<T>(this,getDF(cls));
} | java | public<T> Put<T> put(Class<T> cls) throws APIException {
return new Put<T>(this,getDF(cls));
} | [
"public",
"<",
"T",
">",
"Put",
"<",
"T",
">",
"put",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"APIException",
"{",
"return",
"new",
"Put",
"<",
"T",
">",
"(",
"this",
",",
"getDF",
"(",
"cls",
")",
")",
";",
"}"
] | Returns a Put Object... same as "update"
@param cls
@return
@throws APIException | [
"Returns",
"a",
"Put",
"Object",
"...",
"same",
"as",
"update"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/client/AAFClient.java#L137-L139 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/client/AAFClient.java | AAFClient.update | public<T> Put<T> update(Class<T> cls) throws APIException {
return new Put<T>(this,getDF(cls));
} | java | public<T> Put<T> update(Class<T> cls) throws APIException {
return new Put<T>(this,getDF(cls));
} | [
"public",
"<",
"T",
">",
"Put",
"<",
"T",
">",
"update",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"APIException",
"{",
"return",
"new",
"Put",
"<",
"T",
">",
"(",
"this",
",",
"getDF",
"(",
"cls",
")",
")",
";",
"}"
] | Returns a Put Object... same as "put"
@param cls
@return
@throws APIException | [
"Returns",
"a",
"Put",
"Object",
"...",
"same",
"as",
"put"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/client/AAFClient.java#L148-L150 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/client/AAFClient.java | AAFClient.delete | public<T> Delete<T> delete(Class<T> cls) throws APIException {
return new Delete<T>(this,getDF(cls));
} | java | public<T> Delete<T> delete(Class<T> cls) throws APIException {
return new Delete<T>(this,getDF(cls));
} | [
"public",
"<",
"T",
">",
"Delete",
"<",
"T",
">",
"delete",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"APIException",
"{",
"return",
"new",
"Delete",
"<",
"T",
">",
"(",
"this",
",",
"getDF",
"(",
"cls",
")",
")",
";",
"}"
] | Returns a Delete Object
@param cls
@return
@throws APIException | [
"Returns",
"a",
"Delete",
"Object"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/client/AAFClient.java#L159-L161 | train |
att/AAF | cadi/core/src/main/java/com/att/cadi/CadiWrap.java | CadiWrap.set | public void set(TafResp tafResp, Lur lur) {
principal = tafResp.getPrincipal();
access = tafResp.getAccess();
this.lur = lur;
} | java | public void set(TafResp tafResp, Lur lur) {
principal = tafResp.getPrincipal();
access = tafResp.getAccess();
this.lur = lur;
} | [
"public",
"void",
"set",
"(",
"TafResp",
"tafResp",
",",
"Lur",
"lur",
")",
"{",
"principal",
"=",
"tafResp",
".",
"getPrincipal",
"(",
")",
";",
"access",
"=",
"tafResp",
".",
"getAccess",
"(",
")",
";",
"this",
".",
"lur",
"=",
"lur",
";",
"}"
] | Allow setting of tafResp and lur after construction
This can happen if the CadiWrap is constructed in a Valve other than CadiValve | [
"Allow",
"setting",
"of",
"tafResp",
"and",
"lur",
"after",
"construction"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/CadiWrap.java#L132-L136 | train |
att/AAF | cadi/core/src/main/java/com/att/cadi/CadiWrap.java | CadiWrap.invalidate | public void invalidate(String id) {
if(lur instanceof EpiLur) {
((EpiLur)lur).remove(id);
} else if(lur instanceof CachingLur) {
((CachingLur<?>)lur).remove(id);
}
} | java | public void invalidate(String id) {
if(lur instanceof EpiLur) {
((EpiLur)lur).remove(id);
} else if(lur instanceof CachingLur) {
((CachingLur<?>)lur).remove(id);
}
} | [
"public",
"void",
"invalidate",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"lur",
"instanceof",
"EpiLur",
")",
"{",
"(",
"(",
"EpiLur",
")",
"lur",
")",
".",
"remove",
"(",
"id",
")",
";",
"}",
"else",
"if",
"(",
"lur",
"instanceof",
"CachingLur",
"... | Add a feature | [
"Add",
"a",
"feature"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/CadiWrap.java#L163-L169 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/http/HMangr.java | HMangr.same | public<RET> RET same(SecuritySetter<HttpURLConnection> ss, Retryable<RET> retryable) throws APIException, CadiException, LocatorException {
RET ret = null;
boolean retry = true;
int retries = 0;
Rcli<HttpURLConnection> client = retryable.lastClient();
try {
do {
// if no previous state, get the best
... | java | public<RET> RET same(SecuritySetter<HttpURLConnection> ss, Retryable<RET> retryable) throws APIException, CadiException, LocatorException {
RET ret = null;
boolean retry = true;
int retries = 0;
Rcli<HttpURLConnection> client = retryable.lastClient();
try {
do {
// if no previous state, get the best
... | [
"public",
"<",
"RET",
">",
"RET",
"same",
"(",
"SecuritySetter",
"<",
"HttpURLConnection",
">",
"ss",
",",
"Retryable",
"<",
"RET",
">",
"retryable",
")",
"throws",
"APIException",
",",
"CadiException",
",",
"LocatorException",
"{",
"RET",
"ret",
"=",
"null"... | Reuse the same service. This is helpful for multiple calls that change service side cached data so that
there is not a speed issue.
If the service goes down, another service will be substituted, if available.
@param access
@param loc
@param ss
@param item
@param retryable
@return
@throws URISyntaxException
@throws E... | [
"Reuse",
"the",
"same",
"service",
".",
"This",
"is",
"helpful",
"for",
"multiple",
"calls",
"that",
"change",
"service",
"side",
"cached",
"data",
"so",
"that",
"there",
"is",
"not",
"a",
"speed",
"issue",
"."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/http/HMangr.java#L53-L127 | train |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/aaf/cass/CacheableData.java | CacheableData.seg | protected int seg(Cached<?,?> cache, Object ... fields) {
return cache==null?0:cache.invalidate(CachedDAO.keyFromObjs(fields));
} | java | protected int seg(Cached<?,?> cache, Object ... fields) {
return cache==null?0:cache.invalidate(CachedDAO.keyFromObjs(fields));
} | [
"protected",
"int",
"seg",
"(",
"Cached",
"<",
"?",
",",
"?",
">",
"cache",
",",
"Object",
"...",
"fields",
")",
"{",
"return",
"cache",
"==",
"null",
"?",
"0",
":",
"cache",
".",
"invalidate",
"(",
"CachedDAO",
".",
"keyFromObjs",
"(",
"fields",
")"... | be treated by system as fields expected in Tables | [
"be",
"treated",
"by",
"system",
"as",
"fields",
"expected",
"in",
"Tables"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/aaf/cass/CacheableData.java#L13-L15 | train |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/CassDAOImpl.java | CassDAOImpl.create | public Result<DATA> create(TRANS trans, DATA data) {
if(createPS==null) {
Result.err(Result.ERR_NotImplemented,"Create is disabled for %s",getClass().getSimpleName());
}
if(async) /*ResultSetFuture */ {
Result<ResultSetFuture> rs = createPS.execAsync(trans, C_TEXT, data);
if(rs.notOK()) {
return Res... | java | public Result<DATA> create(TRANS trans, DATA data) {
if(createPS==null) {
Result.err(Result.ERR_NotImplemented,"Create is disabled for %s",getClass().getSimpleName());
}
if(async) /*ResultSetFuture */ {
Result<ResultSetFuture> rs = createPS.execAsync(trans, C_TEXT, data);
if(rs.notOK()) {
return Res... | [
"public",
"Result",
"<",
"DATA",
">",
"create",
"(",
"TRANS",
"trans",
",",
"DATA",
"data",
")",
"{",
"if",
"(",
"createPS",
"==",
"null",
")",
"{",
"Result",
".",
"err",
"(",
"Result",
".",
"ERR_NotImplemented",
",",
"\"Create is disabled for %s\"",
",",
... | Given a DATA object, extract the individual elements from the Data into an Object Array for the
execute element. | [
"Given",
"a",
"DATA",
"object",
"extract",
"the",
"individual",
"elements",
"from",
"the",
"Data",
"into",
"an",
"Object",
"Array",
"for",
"the",
"execute",
"element",
"."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/CassDAOImpl.java#L166-L183 | train |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/CassDAOImpl.java | CassDAOImpl.read | public Result<List<DATA>> read(TRANS trans, DATA data) {
if(readPS==null) {
Result.err(Result.ERR_NotImplemented,"Read is disabled for %s",getClass().getSimpleName());
}
return readPS.read(trans, R_TEXT, data);
} | java | public Result<List<DATA>> read(TRANS trans, DATA data) {
if(readPS==null) {
Result.err(Result.ERR_NotImplemented,"Read is disabled for %s",getClass().getSimpleName());
}
return readPS.read(trans, R_TEXT, data);
} | [
"public",
"Result",
"<",
"List",
"<",
"DATA",
">",
">",
"read",
"(",
"TRANS",
"trans",
",",
"DATA",
"data",
")",
"{",
"if",
"(",
"readPS",
"==",
"null",
")",
"{",
"Result",
".",
"err",
"(",
"Result",
".",
"ERR_NotImplemented",
",",
"\"Read is disabled ... | Read the Unique Row associated with Full Keys | [
"Read",
"the",
"Unique",
"Row",
"associated",
"with",
"Full",
"Keys"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/CassDAOImpl.java#L188-L193 | train |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/CassDAOImpl.java | CassDAOImpl.delete | public Result<Void> delete(TRANS trans, DATA data, boolean reread) {
if(deletePS==null) {
Result.err(Result.ERR_NotImplemented,"Delete is disabled for %s",getClass().getSimpleName());
}
// Since Deleting will be stored off, for possible re-constitution, need the whole thing
if(reread) {
Result<List<DATA>>... | java | public Result<Void> delete(TRANS trans, DATA data, boolean reread) {
if(deletePS==null) {
Result.err(Result.ERR_NotImplemented,"Delete is disabled for %s",getClass().getSimpleName());
}
// Since Deleting will be stored off, for possible re-constitution, need the whole thing
if(reread) {
Result<List<DATA>>... | [
"public",
"Result",
"<",
"Void",
">",
"delete",
"(",
"TRANS",
"trans",
",",
"DATA",
"data",
",",
"boolean",
"reread",
")",
"{",
"if",
"(",
"deletePS",
"==",
"null",
")",
"{",
"Result",
".",
"err",
"(",
"Result",
".",
"ERR_NotImplemented",
",",
"\"Delet... | This method Sig for Cached... | [
"This",
"method",
"Sig",
"for",
"Cached",
"..."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/CassDAOImpl.java#L223-L265 | train |
att/AAF | authz/authz-batch/src/main/java/com/att/authz/helpers/Notification.java | Notification.update | private String update() {
// If this has been done before, there is no change in checkSum and the last time notified is within GracePeriod
if(checksum!=0 && checksum()==checksum && now < last.getTime()+graceEnds && now > last.getTime()+lastdays) {
return null;
} else {
return "UPDATE authz.notify SET last =... | java | private String update() {
// If this has been done before, there is no change in checkSum and the last time notified is within GracePeriod
if(checksum!=0 && checksum()==checksum && now < last.getTime()+graceEnds && now > last.getTime()+lastdays) {
return null;
} else {
return "UPDATE authz.notify SET last =... | [
"private",
"String",
"update",
"(",
")",
"{",
"// If this has been done before, there is no change in checkSum and the last time notified is within GracePeriod",
"if",
"(",
"checksum",
"!=",
"0",
"&&",
"checksum",
"(",
")",
"==",
"checksum",
"&&",
"now",
"<",
"last",
".",... | Returns an Update String for CQL if there is data.
Returns null if nothing to update
@return | [
"Returns",
"an",
"Update",
"String",
"for",
"CQL",
"if",
"there",
"is",
"data",
"."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-batch/src/main/java/com/att/authz/helpers/Notification.java#L247-L262 | train |
att/AAF | cadi/core/src/main/java/com/att/cadi/AbsUserCache.java | AbsUserCache.addUser | protected void addUser(String key, User<PERM> user) {
userMap.put(key, user);
} | java | protected void addUser(String key, User<PERM> user) {
userMap.put(key, user);
} | [
"protected",
"void",
"addUser",
"(",
"String",
"key",
",",
"User",
"<",
"PERM",
">",
"user",
")",
"{",
"userMap",
".",
"put",
"(",
"key",
",",
"user",
")",
";",
"}"
] | Useful for looking up by WebToken, etc. | [
"Useful",
"for",
"looking",
"up",
"by",
"WebToken",
"etc",
"."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/AbsUserCache.java#L78-L80 | train |
att/AAF | cadi/core/src/main/java/com/att/cadi/AbsUserCache.java | AbsUserCache.addMiss | protected boolean addMiss(String key, byte[] bs) {
Miss miss = missMap.get(key);
if(miss==null) {
synchronized(missMap) {
missMap.put(key, new Miss(bs,clean==null?MIN_INTERVAL:clean.timeInterval));
}
return true;
}
return miss.add(bs);
} | java | protected boolean addMiss(String key, byte[] bs) {
Miss miss = missMap.get(key);
if(miss==null) {
synchronized(missMap) {
missMap.put(key, new Miss(bs,clean==null?MIN_INTERVAL:clean.timeInterval));
}
return true;
}
return miss.add(bs);
} | [
"protected",
"boolean",
"addMiss",
"(",
"String",
"key",
",",
"byte",
"[",
"]",
"bs",
")",
"{",
"Miss",
"miss",
"=",
"missMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"miss",
"==",
"null",
")",
"{",
"synchronized",
"(",
"missMap",
")",
"{",
... | Add miss to missMap. If Miss exists, or too many tries, returns false.
otherwise, returns true to allow another attempt.
@param key
@param bs
@return | [
"Add",
"miss",
"to",
"missMap",
".",
"If",
"Miss",
"exists",
"or",
"too",
"many",
"tries",
"returns",
"false",
"."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/AbsUserCache.java#L91-L100 | train |
att/AAF | cadi/core/src/main/java/com/att/cadi/AbsUserCache.java | AbsUserCache.remove | public void remove(String user) {
Object o = userMap.remove(user);
if(o!=null) {
access.log(Level.INFO, user,"removed from Client Cache by Request");
}
} | java | public void remove(String user) {
Object o = userMap.remove(user);
if(o!=null) {
access.log(Level.INFO, user,"removed from Client Cache by Request");
}
} | [
"public",
"void",
"remove",
"(",
"String",
"user",
")",
"{",
"Object",
"o",
"=",
"userMap",
".",
"remove",
"(",
"user",
")",
";",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"access",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"user",
",",
"\"remove... | Removes user from the Cache
@param user | [
"Removes",
"user",
"from",
"the",
"Cache"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/AbsUserCache.java#L131-L136 | train |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/CachedDAO.java | CachedDAO.read | public Result<List<DATA>> read(final String key, final TRANS trans, final Object ... objs) {
DAOGetter getter = new DAOGetter(trans,dao,objs);
return get(trans, key, getter);
// if(ld!=null) {
// return Result.ok(ld);//.emptyList(ld.isEmpty());
// }
// // Result Result if exists
// if(getter.result==null) {
... | java | public Result<List<DATA>> read(final String key, final TRANS trans, final Object ... objs) {
DAOGetter getter = new DAOGetter(trans,dao,objs);
return get(trans, key, getter);
// if(ld!=null) {
// return Result.ok(ld);//.emptyList(ld.isEmpty());
// }
// // Result Result if exists
// if(getter.result==null) {
... | [
"public",
"Result",
"<",
"List",
"<",
"DATA",
">",
">",
"read",
"(",
"final",
"String",
"key",
",",
"final",
"TRANS",
"trans",
",",
"final",
"Object",
"...",
"objs",
")",
"{",
"DAOGetter",
"getter",
"=",
"new",
"DAOGetter",
"(",
"trans",
",",
"dao",
... | Slight Improved performance available when String and Obj versions are known. | [
"Slight",
"Improved",
"performance",
"available",
"when",
"String",
"and",
"Obj",
"versions",
"are",
"known",
"."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/CachedDAO.java#L141-L152 | train |
att/AAF | cadi/core/src/main/java/com/att/cadi/principal/TGuardPrincipal.java | TGuardPrincipal.get | public String get(String key) {
if(key==null)return null;
int idx=0,equal=0,amp=0;
while(idx>=0 && (equal = tresp.indexOf('=',idx))>=0) {
amp = tresp.indexOf('&',equal);
if(key.regionMatches(0, tresp, idx, equal-idx)) {
return amp>=0?tresp.substring(equal+1, amp):tresp.substring(equal+1);
}
idx=a... | java | public String get(String key) {
if(key==null)return null;
int idx=0,equal=0,amp=0;
while(idx>=0 && (equal = tresp.indexOf('=',idx))>=0) {
amp = tresp.indexOf('&',equal);
if(key.regionMatches(0, tresp, idx, equal-idx)) {
return amp>=0?tresp.substring(equal+1, amp):tresp.substring(equal+1);
}
idx=a... | [
"public",
"String",
"get",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"return",
"null",
";",
"int",
"idx",
"=",
"0",
",",
"equal",
"=",
"0",
",",
"amp",
"=",
"0",
";",
"while",
"(",
"idx",
">=",
"0",
"&&",
"(",
"equa... | Get a value from a named TGuard Property
TGuard response info is very dynamic. They can add new properties at any time, so we dare not code field names for these values.
@param key
@return | [
"Get",
"a",
"value",
"from",
"a",
"named",
"TGuard",
"Property"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/principal/TGuardPrincipal.java#L45-L56 | train |
att/AAF | authz/authz-service/src/main/java/com/att/authz/service/api/API_Creds.java | API_Creds.timeSensitiveInit | public static void timeSensitiveInit(Env env, AuthAPI authzAPI, AuthzFacade facade, final DirectAAFUserPass directAAFUserPass) throws Exception {
/**
* Basic Auth, quick Validation
*
* Responds OK or NotAuthorized
*/
authzAPI.route(env, HttpMethods.GET, "/authn/basicAuth", new Code(facade,"Is given Bas... | java | public static void timeSensitiveInit(Env env, AuthAPI authzAPI, AuthzFacade facade, final DirectAAFUserPass directAAFUserPass) throws Exception {
/**
* Basic Auth, quick Validation
*
* Responds OK or NotAuthorized
*/
authzAPI.route(env, HttpMethods.GET, "/authn/basicAuth", new Code(facade,"Is given Bas... | [
"public",
"static",
"void",
"timeSensitiveInit",
"(",
"Env",
"env",
",",
"AuthAPI",
"authzAPI",
",",
"AuthzFacade",
"facade",
",",
"final",
"DirectAAFUserPass",
"directAAFUserPass",
")",
"throws",
"Exception",
"{",
"/**\n\t\t * Basic Auth, quick Validation\n\t\t * \n\t\t * ... | TIME SENSITIVE APIs
These will be first in the list
@param env
@param authzAPI
@param facade
@param directAAFUserPass
@throws Exception | [
"TIME",
"SENSITIVE",
"APIs"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-service/src/main/java/com/att/authz/service/api/API_Creds.java#L51-L139 | train |
att/AAF | authz/authz-cass/src/main/java/com/att/dao/aaf/cass/RoleDAO.java | RoleDAO.addDescription | public Result<Void> addDescription(AuthzTrans trans, String ns, String name, String description) {
try {
getSession(trans).execute(UPDATE_SP + TABLE + " SET description = '"
+ description + "' WHERE ns = '" + ns + "' AND name = '" + name + "';");
} catch (DriverException | APIException | IOException e) {
... | java | public Result<Void> addDescription(AuthzTrans trans, String ns, String name, String description) {
try {
getSession(trans).execute(UPDATE_SP + TABLE + " SET description = '"
+ description + "' WHERE ns = '" + ns + "' AND name = '" + name + "';");
} catch (DriverException | APIException | IOException e) {
... | [
"public",
"Result",
"<",
"Void",
">",
"addDescription",
"(",
"AuthzTrans",
"trans",
",",
"String",
"ns",
",",
"String",
"name",
",",
"String",
"description",
")",
"{",
"try",
"{",
"getSession",
"(",
"trans",
")",
".",
"execute",
"(",
"UPDATE_SP",
"+",
"T... | Add description to role
@param trans
@param ns
@param name
@param description
@return | [
"Add",
"description",
"to",
"role"
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-cass/src/main/java/com/att/dao/aaf/cass/RoleDAO.java#L341-L355 | train |
att/AAF | cadi/client/src/main/java/com/att/cadi/dme2/DEClient.java | DEClient.setPathInfo | public void setPathInfo(String pathinfo) {
int qp = pathinfo.indexOf('?');
if(qp<0) {
client.setContext(isProxy?("/proxy"+pathinfo):pathinfo);
} else {
client.setContext(isProxy?("/proxy"+pathinfo.substring(0,qp)):pathinfo.substring(0,qp));
client.setQueryParams(pathinfo.substring(qp+1));
}
} | java | public void setPathInfo(String pathinfo) {
int qp = pathinfo.indexOf('?');
if(qp<0) {
client.setContext(isProxy?("/proxy"+pathinfo):pathinfo);
} else {
client.setContext(isProxy?("/proxy"+pathinfo.substring(0,qp)):pathinfo.substring(0,qp));
client.setQueryParams(pathinfo.substring(qp+1));
}
} | [
"public",
"void",
"setPathInfo",
"(",
"String",
"pathinfo",
")",
"{",
"int",
"qp",
"=",
"pathinfo",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"qp",
"<",
"0",
")",
"{",
"client",
".",
"setContext",
"(",
"isProxy",
"?",
"(",
"\"/proxy\"",
"... | DME2 can't handle having QueryParams on the URL line, but it is the most natural way, so...
Also, DME2 can't handle "/proxy" as part of Context in the main URI line, so we add it when we see authz-gw to "isProxy" | [
"DME2",
"can",
"t",
"handle",
"having",
"QueryParams",
"on",
"the",
"URL",
"line",
"but",
"it",
"is",
"the",
"most",
"natural",
"way",
"so",
"..."
] | 090562e956c0035db972aafba844dc6d3fc948ee | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/client/src/main/java/com/att/cadi/dme2/DEClient.java#L52-L60 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.