This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn archetype:generate \ | |
-DarchetypeGroupId=org.juzu \ | |
-DarchetypeArtifactId=juzu-archetype \ | |
-DarchetypeVersion=0.4.2 \ | |
-DgroupId=<my.groupid> \ | |
-DartifactId=<my-artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.prototype.toJava = function() { | |
var m = new java.util.HashMap(); | |
for (var key in this) | |
if (this.hasOwnProperty(key)) | |
m.put(key, this[key].toJava()); | |
return m; | |
}; | |
Array.prototype.toJava = function() { | |
var l = this.length; | |
var a = new java.lang.reflect.Array.newInstance(java.lang.Object, l); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JSON2Java { | |
private static final ScriptEngine jsonParser; | |
static | |
{ | |
try | |
{ | |
String init = read(Tools.class.getResource("json2java.js")); | |
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<route path="/scripts/{gtn:version}/{gtn:scope}/"> | |
<route-param qname="gtn:handler"> | |
<value>script</value> | |
</route-param> | |
<path-param qname="gtn:version" encoding="preserve-path"> | |
<pattern>[^/]*</pattern> | |
</path-param> | |
<route path="/{gtn:resource}{gtn:lang}{gtn:compress}.js"> | |
<path-param qname="gtn:resource"> | |
<pattern>.+?</pattern> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SEVERE: Allocate exception for servlet PortalServlet | |
java.net.SocketException: Connection reset | |
at java.net.SocketInputStream.read(SocketInputStream.java:168) | |
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) | |
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) | |
at java.io.BufferedInputStream.read(BufferedInputStream.java:317) | |
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687) | |
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) | |
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:652) | |
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.gatein.portal.people; | |
import org.exoplatform.commons.utils.ListAccess; | |
import org.exoplatform.services.organization.Group; | |
import org.exoplatform.services.organization.GroupHandler; | |
import org.exoplatform.services.organization.Membership; | |
import org.exoplatform.services.organization.MembershipHandler; | |
import org.exoplatform.services.organization.MembershipType; | |
import org.exoplatform.services.organization.MembershipTypeHandler; | |
import org.exoplatform.services.organization.OrganizationService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% groups.each { group -> %> | |
<li class="group"> | |
<% | |
def toAddByGroup = toAdd[group.id]; | |
if (toAddByGroup != null && !toAddByGroup.isEmpty()) { | |
%> | |
<ul class="unstyled add-memberships"> | |
<li>memberships</li> | |
<li> | |
<ul class="unstyled"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java Compiler APT hack to determine the source path of a file | |
Trees trees = Trees.instance(env); | |
TreePath path = trees.getPath(myTypeElement); | |
JavaFileObject source = path.getCompilationUnit().getSourceFile(); | |
File sourceFile = new File(source.toUri().toURL().getPath()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (manager.declaredBeans.contains(type)) | |
{ | |
if (Provider.class.isAssignableFrom(type)) | |
{ | |
final AnnotatedType<T> at = pat.getAnnotatedType(); | |
AnnotatedType<T> providerType = new AnnotatedType<T>() { | |
public Class<T> getJavaClass() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new UIBuilder().table() { | |
row([ | |
values:["ID", "PRIORITY", "STATE", "INTERRUPTED","DAEMON", "NAME"], | |
styles:[new Style(Decoration.BOLD, Color.BLACK, Color.WHITE)] | |
]) | |
threads.each() { | |
if (it != null) { | |
def matcher = it.name =~ pattern; | |
if (matcher.matches() && (state == null || it.state == state)) { | |
Color c = null; |