private static Map getParts(EJValue value) { return ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(value, new DecodingSession(MappingContextSingleton.get())); }
public static ServerMappingContext loadDynamicMarshallers() { dynamicMarshallingWarning();
public static ServerMappingContext loadDynamicMarshallers() { dynamicMarshallingWarning();
@SuppressWarnings("unchecked") public static Message createCommandMessage(QueueSession session, String json) { if (json.length() == 0) return null; Message msg = createWithPartsFromRawMap(ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(json), new DecodingSession(MappingContextSingleton.get()))) .setResource("Session", session) .setResource("SessionID", session.getSessionId()); msg.setFlag(RoutingFlag.FromRemote); return msg; }
@Override public void init(FilterConfig filterConfig) throws ServletException { // Initialize server side marshaller MappingContextSingleton.get(); }
private void initializeMarshaller() { MappingContextSingleton.get(); }
@Override public void initialize(FilterConfig filterConfig) { String contextRelativeHostPageUri = filterConfig.getInitParameter(HOST_PAGE_INIT_PARAM); if (contextRelativeHostPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + HOST_PAGE_INIT_PARAM + "\" to the context-relative URI of the host page."); } hostPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeHostPageUri; String contextRelativeLoginPageUri = filterConfig.getInitParameter(LOGIN_PAGE_INIT_PARAM); if (contextRelativeLoginPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + LOGIN_PAGE_INIT_PARAM + "\" to the context-relative URI of the login page."); } loginPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeLoginPageUri; // this ensures Errai Marshalling has been set up (for encoding the cookie) MappingContextSingleton.get(); }
@Override public void initialize(FilterConfig filterConfig) { String contextRelativeHostPageUri = filterConfig.getInitParameter(HOST_PAGE_INIT_PARAM); if (contextRelativeHostPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + HOST_PAGE_INIT_PARAM + "\" to the context-relative URI of the host page."); } hostPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeHostPageUri; String contextRelativeLoginPageUri = filterConfig.getInitParameter(LOGIN_PAGE_INIT_PARAM); if (contextRelativeLoginPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + LOGIN_PAGE_INIT_PARAM + "\" to the context-relative URI of the login page."); } loginPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeLoginPageUri; // this ensures Errai Marshalling has been set up (for encoding the cookie) MappingContextSingleton.get(); }
@Override public void init(FilterConfig filterConfig) throws ServletException { MappingContextSingleton.get(); String commaSeparatedRoles = filterConfig.getInitParameter(PROBE_ROLES_INIT_PARAM); if (commaSeparatedRoles != null) { for (final String role : Collections.unmodifiableList(Arrays.asList(commaSeparatedRoles.split(",")))) { RoleRegistry.get().registerRole(role); } } }
@Override public void init(FilterConfig filterConfig) throws ServletException { MappingContextSingleton.get(); String commaSeparatedRoles = filterConfig.getInitParameter(PROBE_ROLES_INIT_PARAM); if (commaSeparatedRoles != null) { for (final String role : Collections.unmodifiableList(Arrays.asList(commaSeparatedRoles.split(",")))) { RoleRegistry.get().registerRole(role); } } }
private static Map getParts(EJValue value) { return ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(value, new DecodingSession(MappingContextSingleton.get())); }
@Override public Set<String> getCandidate(final GeneratorContext context, final DiscoveryContext discoveryContext) { final ServerMappingContext ctx = MappingContextSingleton.get(); final Map<String, String> matchNames = new HashMap<String, String>(); for (final MetaClass cls : ctx.getDefinitionsFactory().getExposedClasses()) { matchNames.put(cls.getName(), cls.getName()); } final File cwd = new File("").getAbsoluteFile(); final Set<File> roots = findMatchingOutputDirectoryByModel(matchNames, cwd); if (roots.isEmpty()) { discoveryContext.veto(); } final Set<String> rootsPaths = new HashSet<String>(); for (final File f : roots) { rootsPaths.add(f.getAbsolutePath()); } return rootsPaths; } }
@Override public Set<String> getCandidate(final GeneratorContext context, final DiscoveryContext discoveryContext) { final ServerMappingContext ctx = MappingContextSingleton.get(); final Map<String, String> matchNames = new HashMap<String, String>(); for (final MetaClass cls : ctx.getDefinitionsFactory().getExposedClasses()) { matchNames.put(cls.getName(), cls.getName()); } final File cwd = new File("").getAbsoluteFile(); final Set<File> roots = findMatchingOutputDirectoryByModel(matchNames, cwd); if (roots.isEmpty()) { discoveryContext.veto(); } final Set<String> rootsPaths = new HashSet<String>(); for (final File f : roots) { rootsPaths.add(f.getAbsolutePath()); } return rootsPaths; } }
@Before public void prepare() throws Exception { MappingContextSingleton.get(); }
@Before public void prepare() throws Exception { MappingContextSingleton.get(); }
public static Message uglyReEncode(String message) { if (message == null) return null; Map<String, Object> parts = ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(message), new DecodingSession(MappingContextSingleton.get())); return CommandMessage.createWithParts(parts); }
public static Message uglyReEncode(String message) { if (message == null) return null; Map<String, Object> parts = ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(message), new DecodingSession(MappingContextSingleton.get())); return CommandMessage.createWithParts(parts); }
final DefinitionsFactory definitionsFactory = MappingContextSingleton.get().getDefinitionsFactory();