org.restlet.engine.Engine Java Examples
The following examples show how to use
org.restlet.engine.Engine.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RestComponent.java From microservices-comparison with Apache License 2.0 | 5 votes |
private static void replaceConverter( Class<? extends ConverterHelper> converterClass, ConverterHelper newConverter) { // TODO java 8-ify List<ConverterHelper> converters = Engine.getInstance().getRegisteredConverters(); for (ConverterHelper converter : converters) { if (converter.getClass().equals(converterClass)) { converters.remove(converter); break; } } converters.add(newConverter); }
Example #2
Source File: PolygeneRestApplication.java From attic-polygene-java with Apache License 2.0 | 5 votes |
@Override public Restlet createInboundRoot() { Context context = getContext(); Engine.getInstance().getRegisteredConverters().add( new PolygeneConverter( objectFactory ) ); if( polygeneApplication.mode() == Application.Mode.development ) { setDebugging( true ); } router = new Router( context ); addRoutes( router ); router.attach( basePath, newPolygeneRestlet( EntryPointResource.class, EntryPoint.class ) ); Verifier verifier = createVerifier(); Enroler enroler = createEnroler(); if( verifier == null && enroler == null ) { return createInterceptors(new Filter() { } ); } else { ChallengeAuthenticator guard = new ChallengeAuthenticator( context, ChallengeScheme.HTTP_BASIC, getName() + " Realm" ); if( verifier != null ) { guard.setVerifier( verifier ); } if( enroler != null ) { guard.setEnroler( enroler ); } return createInterceptors( guard ); } }
Example #3
Source File: WorkspaceResourceServerManager.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public static synchronized WorkspaceResourceServerManager getInstance() { if (INSTANCE == null) { Engine.setRestletLogLevel(Level.OFF); INSTANCE = new WorkspaceResourceServerManager(); } return INSTANCE; }