@Override public Identifier getIdentifier() { return parentAction.getIdentifier(); }
@Override public VisibilityContext<?> createVisibleInteractionContext(final AuthenticationSession session, final InteractionInvocationMethod invocationMethod, final ObjectAdapter targetObjectAdapter) { return new ActionVisibilityContext(session, invocationMethod, targetObjectAdapter, getIdentifier()); }
@Override public UsabilityContext<?> createUsableInteractionContext(final AuthenticationSession session, final InteractionInvocationMethod invocationMethod, final ObjectAdapter targetObjectAdapter) { return new ActionUsabilityContext(session, invocationMethod, targetObjectAdapter, getIdentifier()); }
@Override public ActionInvocationContext createActionInvocationInteractionContext(final AuthenticationSession session, final InteractionInvocationMethod invocationMethod, final ObjectAdapter targetObject, final ObjectAdapter[] proposedArguments) { return new ActionInvocationContext(getAuthenticationSession(), invocationMethod, targetObject, getIdentifier(), proposedArguments); }
/** * Build lazily by {@link #getParameters()}. * * <p> * Although this is lazily loaded, the method is also <tt>synchronized</tt> * so there shouldn't be any thread race conditions. */ @Override public synchronized List<ObjectActionParameter> getParameters() { if (this.parameters == null) { final int parameterCount = getParameterCount(); final List<ObjectActionParameter> parameters = Lists.newArrayList(); final List<FacetedMethodParameter> paramPeers = getFacetedMethod().getParameters(); for (int i = 0; i < parameterCount; i++) { final TypedHolder paramPeer = paramPeers.get(i); final ObjectSpecification specification = ObjectMemberAbstract.getSpecification(getSpecificationLookup(), paramPeer.getType()); if (specification.isParseable()) { parameters.add(new ObjectActionParameterParseable(i, this, paramPeer)); } else if (specification.isNotCollection()) { parameters.add(new OneToOneActionParameterImpl(i, this, paramPeer)); } else if (specification.isCollection()) { throw new UnknownTypeException("collections not supported as parameters: " + getIdentifier()); } else { throw new UnknownTypeException(specification); } } this.parameters = parameters; } return parameters; }