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.jboss.errai.jpa.client.local; | |
import com.google.gwt.json.client.JSONObject; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.Map; | |
import javax.persistence.CascadeType; | |
import javax.persistence.TypedQuery; | |
import javax.persistence.metamodel.Attribute.PersistentAttributeType; | |
import javax.persistence.metamodel.Bindable.BindableType; |
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
.E17l0oxA { | |
background : greenyellow; | |
margin-top : 3px; | |
} | |
.E17l0oxB , .E17l0oxC { | |
background : greenyellow; | |
} | |
div.E17l0oxD { | |
text-decoration : #000; | |
} |
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
.E17l0oxA { | |
background : greenyellow; | |
margin-top : 3px; | |
} | |
.E17l0oxB , .E17l0oxC { | |
background : greenyellow; | |
} | |
div.E17l0oxD { | |
text-decoration : #000; | |
} |
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
@Templated | |
@Page | |
public class GroceryListView extends Composite { | |
@PageState | |
private long activeUserId; | |
@Sync(query = "groceryListsForUser", | |
params = { @SyncParam(name = "userId", val = "{activeUserId}") }) | |
private void onDataSyncComplete(SyncResponses<GroceryList> responses) { |
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
@UncaughtException | |
private void onUncaughtException(Throwable caught) { | |
try { | |
throw caught; | |
} | |
catch (UserNotAuthenticatedException e) { | |
// navigate to login dialog | |
} | |
catch (Throwable t) { | |
logger.error("An unexpected error has occurred", t); |
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
@Remote | |
public interface LongRunningService { | |
public CallableFuture<String> someLongRunningTask(); | |
} |
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
@Service | |
public class LongRunningServiceImpl implements LongRunningService { | |
@Override | |
public CallableFuture<String> someLongRunningTask() { | |
final CallableFuture<String> future = | |
CallableFutureFactory.get().createFuture(String.class); | |
// Start some asynchronous, potentially slow computation | |
SomeSlowStringComputation slow = new SomeSlowStringComputation(); |
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
@Dependent | |
@InterceptsRemoteCall({ MyRemoteInterface.class, MyOtherRemoteInterface.class }) | |
public class MyCacheInterceptor implements RpcInterceptor { | |
@Inject | |
private MyAppCache cache; | |
@Override | |
public void aroundInvoke(final RemoteCallContext context) { | |
// e.g check if the result is cached and carry out |
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.sql.Date sqldate = new java.sql.Date(70, 0, 2); | |
DateFormat df = DateFormat.getDateTimeInstance(); | |
df.setTimeZone( TimeZone.getTimeZone( "GMT" ) ); | |
System.out.println("Created with YMD: " + df.format(sqldate)); |
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 BasicAuthInterceptor implements RestClientInterceptor { | |
@Override | |
public void aroundInvoke(final RestCallContext context) { | |
RequestBuilder builder = context.getRequestBuilder(); | |
builder.setUser(MyApp.getCurrentUser().getName()); | |
builder.setPassword(MyApp.getCurrentUser().getPassword()); | |
context.proceed(); | |
} |
OlderNewer