001/** 002 * GRANITE DATA SERVICES 003 * Copyright (C) 2006-2013 GRANITE DATA SERVICES S.A.S. 004 * 005 * This file is part of the Granite Data Services Platform. 006 * 007 * *** 008 * 009 * Community License: GPL 3.0 010 * 011 * This file is free software: you can redistribute it and/or modify 012 * it under the terms of the GNU General Public License as published 013 * by the Free Software Foundation, either version 3 of the License, 014 * or (at your option) any later version. 015 * 016 * This file is distributed in the hope that it will be useful, but 017 * WITHOUT ANY WARRANTY; without even the implied warranty of 018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 019 * GNU General Public License for more details. 020 * 021 * You should have received a copy of the GNU General Public License 022 * along with this program. If not, see <http://www.gnu.org/licenses/>. 023 * 024 * *** 025 * 026 * Available Commercial License: GraniteDS SLA 1.0 027 * 028 * This is the appropriate option if you are creating proprietary 029 * applications and you are not prepared to distribute and share the 030 * source code of your application under the GPL v3 license. 031 * 032 * Please visit http://www.granitedataservices.com/license for more 033 * details. 034 */ 035package org.granite.client.tide; 036 037import java.util.Map; 038 039/** 040 * SPI for platform-specific integration 041 * 042 * Allows to define default components available in all contexts or apply specific configurations on components annotated with {@link org.granite.client.tide.ApplicationConfigurable} 043 * 044 * @author William DRAI 045 * @see org.granite.client.tide.ApplicationConfigurable 046 */ 047public interface Application { 048 049 /** 050 * Define a map of beans that will be setup in the context before initialization 051 * @param context Tide context 052 * @param initialBeans map of bean instances keyed by name 053 */ 054 public void initContext(Context context, Map<String, Object> initialBeans); 055 056 /** 057 * Configure a bean instance for platform-specific behaviour 058 * @param instance bean instance 059 */ 060 public void configure(Object instance); 061 062 /** 063 * Integration with deferred execution of a runnable on the UI thread 064 * @param runnable runnable to execute in the UI thread 065 */ 066 public void execute(Runnable runnable); 067}