Skip to content

Instantly share code, notes, and snippets.

@msulima
msulima / gist:3187477
Created July 27, 2012 11:24
EventResignServiceImpl
package com.futureprocessing.fpcommunity.core.services.events;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.neo4j.template.Neo4jOperations;
import org.springframework.stereotype.Service;
import org.springframework.validation.Validator;
import com.futureprocessing.fpcommunity.core.datetime.IDateTime;
import com.futureprocessing.fpcommunity.core.domain.Event;
import com.futureprocessing.fpcommunity.core.domain.User;
import com.futureprocessing.fpcommunity.core.exceptions.EventEndedException;
@msulima
msulima / gist:3187475
Created July 27, 2012 11:23
FulfilsPredicate
package com.futureprocessing.fpcommunity.core.validation.groups;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.google.common.base.Predicate;
@Target(value = ElementType.PARAMETER)
@Retention(value = RetentionPolicy.RUNTIME)
@msulima
msulima / gist:3187473
Created July 27, 2012 11:23
FulfilsPredicateAspect
package com.futureprocessing.fpcommunity.core.validation.groups;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Component;
public aspect FulfilsPredicateAspect {
pointcut hasFulfisPredicateArguments() : execution(* *(.., @com.futureprocessing.fpcommunity.core.validation.groups.FulfilsPredicate (*) ,..));
pointcut isSpringComponent() : (@within(Service) || @within(Component)) && within(com.futureprocessing.fpcommunity..*);
before() : hasFulfisPredicateArguments() && isSpringComponent() {