Skip to content

Instantly share code, notes, and snippets.

@BenDol
BenDol / gist:f709edfb1ed4435811a2
Created May 5, 2015 10:04
Multiple parameters (can't they be joined in a list?)
@POST
RestAction<Action> add(Action action, Notification notification, Email email);
/**
* The protocol for rest controller: {@link nz.co.doltech.actions.server.controllers.ManagementsController}
*/
@Path(Managements.ROOT)
public interface ManagementsProtocol extends Protocol {
@POST
@Path(PATH_REQUEST_COUNT)
RestAction<RequestCounts> getRequestCounts(Filter filter);
}
/*
Management API Branch
*/
/** Managements API Structure, root: {@value Managements#ROOT} */
public static interface Managements extends PathBranch {
public static final String ROOT = "/" + Params.MANAGEMENTS;
public static final String PATH_ID = "/{" + Params.ID + "}";
public static final String PATH_REQUEST_COUNT = "/request_counts";
public class RestModule extends AbstractGinModule {
@Override
public void configure() {
install(new RestDispatchAsyncModule.Builder()
.addGlobalHeaderParam(RestCache.CACHE_CONTROL)
.toHttpMethods(HttpMethod.GET)
.withValue("no-cache")
.dispatchHooks(RestDispatchHook.class)
.build());
@BenDol
BenDol / ManagementsProtocolImpl_0_getRequestCounts.java
Created May 6, 2015 12:01
Generated ManagementsProtocolImpl_0_getRequestCounts
package nz.co.doltech.actions.client.rest;
import javax.ws.rs.core.HttpHeaders;
import com.gwtplatform.dispatch.rest.client.AbstractRestAction;
import com.gwtplatform.dispatch.rest.client.parameters.HttpParameterFactory;
import com.gwtplatform.dispatch.rest.shared.HttpMethod;
import com.gwtplatform.dispatch.rest.shared.HttpParameter.Type;
public class ManagementsProtocolImpl_0_getRequestCounts extends AbstractRestAction<nz.co.doltech.actions.shared.core.RequestCounts> {
@BenDol
BenDol / ManagementsProtocolImpl.java
Created May 6, 2015 12:02
Generated ManagementsProtocolImpl
package nz.co.doltech.actions.client.rest;
import javax.inject.Inject;
import com.gwtplatform.dispatch.rest.client.DefaultDateFormat;
import com.gwtplatform.dispatch.rest.client.parameters.HttpParameterFactory;
import com.gwtplatform.dispatch.rest.shared.RestAction;
import nz.co.doltech.actions.client.rest.ManagementsProtocol;
import nz.co.doltech.actions.client.rest.ManagementsProtocolImpl_0_getRequestCounts;
@BenDol
BenDol / EmailServiceImpl.java
Last active October 6, 2016 21:14
The cyclic dependency issue with Spring 4 (worked fine in Spring 3)
@Service("emailService")
public class EmailServiceImpl extends MailServiceImpl implements EmailService, InitializingBean {
private static final long serialVersionUID = -7973057973637014852L;
private static final Logger logger = Logger.getLogger(EmailServiceImpl.class.getName());
@Autowired
private EntityMapperContext mapperContext;
@BenDol
BenDol / ServerModule.java
Created May 12, 2015 03:05
Spring EntryPoint code
/**
* Module which binds the handlers and configurations.
*/
@Configuration
@Import({
PropertiesModule.class,
HttpModule.class,
WebSocketModule.class,
OptionalModule.class,
ComponentModule.class,
@BenDol
BenDol / gist:adbcfce667ed826445c7
Last active August 29, 2015 14:21
Stack Results When Debugging DefaultSingletonBeanRegistry class
isDependent():455, DefaultSingletonBeanRegistry (org.springframework.beans.factory.support) 7]
LOOP BACK TO STACK 3 - Same as 3
isDependent():455, DefaultSingletonBeanRegistry (org.springframework.beans.factory.support) [6]
beanName: entityService
dependentBeanName: transactionManager
cononicalName: entityService
dependentBeans: size = 5
transitiveDependency: eventService
package doltech.api.wayhome.shared.models;
import fr.lteconsulting.hexa.databinding.properties.Properties;
import com.google.gwt.core.client.GWT;
import fr.lteconsulting.hexa.classinfo.gwt.ClazzBundle;
import fr.lteconsulting.hexa.classinfo.gwt.ReflectedClasses;
/**
* Observable class generated from {@link doltech.api.wayhome.shared.models.Setting}
* Generated by HexaBinding