/** * Constructor. By default, it creates the necessary services. * * @param enabled * True if the service has been enabled. * */ public StatusService(boolean enabled) { this(enabled, new ConverterService(), new MetadataService(), new ConnegService()); // this.homeRef = new Reference("/"); }
/** * Constructor. */ public ConverterProvider() { Application application = Application.getCurrent(); if (application != null) { this.converterService = application.getConverterService(); } if (this.converterService == null) { this.converterService = new ConverterService(); } }
/** * Returns the application's converter service or create a new one. * * @return The converter service. */ public org.restlet.service.ConverterService getConverterService() { org.restlet.service.ConverterService result = null; result = getApplication().getConverterService(); if (result == null) { result = new org.restlet.service.ConverterService(); } return result; }
/** * Returns the converter service. * * @return The converter service. * @deprecated Since 1.1, the ConverterService is deprecated, with no * replacement as it doesn't fit well with content negotiation. * Most users prefer to handle those conversion in Resource * subclasses. */ @Deprecated private org.restlet.service.ConverterService getConverterService() { org.restlet.service.ConverterService result = null; final Application application = Application.getCurrent(); if (application != null) { result = application.getConverterService(); } else { result = new org.restlet.service.ConverterService(); } return result; }
/** * Constructor. * * @param context * The context to use based on parent component context. This * context should be created using the * {@link Context#createChildContext()} method to ensure a proper * isolation with the other applications. */ @SuppressWarnings("deprecation") public Application(Context context) { super(context); if (Engine.getInstance() != null) { this.helper = Engine.getInstance().createHelper(this); } this.name = null; this.description = null; this.author = null; this.owner = null; this.root = null; this.connectorService = new ConnectorService(); this.converterService = new org.restlet.service.ConverterService(); this.decoderService = new DecoderService(); this.metadataService = new MetadataService(); this.rangeService = new RangeService(); this.statusService = new StatusService(); this.taskService = new TaskService(); this.tunnelService = new TunnelService(true, true); }
ConverterService converterService = new ConverterService(); MetadataService metadataService = new MetadataService();