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
@Path("customers") | |
public interface CustomerService { | |
@GET | |
@Produces("application/json") | |
public List<Customer> listAllCustomers(); | |
@POST | |
@Consumes("application/json") | |
@Produces("text/plain") | |
public long createCustomer(Customer customer); |
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
@EntryPoint | |
public class App { | |
... | |
final RemoteCallback<Long> callback = new RemoteCallback<Long>() { | |
public void callback(Long id) { | |
Window.alert("Customer created with ID: " + id); | |
} | |
}; | |
@PostConstruct |
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
final ErrorCallback errorCallback = new ErrorCallback() { | |
public boolean error(Message message, Throwable throwable) { | |
try { | |
throw throwable; | |
} | |
catch (ResponseException e) { | |
Response response = e.getResponse(); | |
// process unexpected response | |
response.getStatusCode(); | |
} |
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(); |