If you think the Android project smsgateway-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
*//fromwww.java2s.com
* ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
*
* (c) 2008-2009 The emite development team (see CREDITS for details)
* This file is part of emite.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/package com.calclab.emite.core.client;
import com.calclab.emite.core.client.bosh.BoshConnection;
import com.calclab.emite.core.client.bosh.Connection;
import com.calclab.emite.core.client.services.Services;
import com.calclab.emite.core.client.services.android.AndroidServices;
import com.calclab.emite.core.client.xmpp.resource.ResourceBindingManager;
import com.calclab.emite.core.client.xmpp.sasl.SASLManager;
import com.calclab.emite.core.client.xmpp.session.IMSessionManager;
import com.calclab.emite.core.client.xmpp.session.Session;
import com.calclab.emite.core.client.xmpp.session.SessionComponent;
import com.calclab.emite.core.client.xmpp.session.SessionImpl;
import com.calclab.emite.core.client.xmpp.session.SessionReady;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
import com.calclab.suco.client.ioc.module.Factory;
import com.calclab.suco.client.log.Logger;
publicclass EmiteCoreModule extends AbstractModule {
public EmiteCoreModule() {
}
@Override
publicvoid onInstall() {
registerDecorator(SessionComponent.class, new SessionComponent(container));
register(Singleton.class, new Factory<Services>(Services.class) {
@Override
public Services create() {
returnnew AndroidServices();
}
});
register(Singleton.class, new Factory<Connection>(Connection.class) {
@Override
public Connection create() {
returnnew BoshConnection($(Services.class));
}
}, new Factory<IMSessionManager>(IMSessionManager.class) {
@Override
public IMSessionManager create() {
returnnew IMSessionManager($(Connection.class));
}
}, new Factory<Session>(Session.class) {
@Override
public Session create() {
final SessionImpl session = new SessionImpl($(Connection.class), $(SASLManager.class),
$(ResourceBindingManager.class), $(IMSessionManager.class));
return session;
}
@Override
publicvoid onAfterCreated(final Session session) {
Logger.debug("Creating Session grouped objects...");
$(SessionComponent.class).createAll();
}
}, new Factory<ResourceBindingManager>(ResourceBindingManager.class) {
@Override
public ResourceBindingManager create() {
returnnew ResourceBindingManager($(Connection.class));
}
}, new Factory<SASLManager>(SASLManager.class) {
@Override
public SASLManager create() {
returnnew SASLManager($(Connection.class));
}
});
register(SessionComponent.class, new Factory<SessionReady>(SessionReady.class) {
@Override
public SessionReady create() {
returnnew SessionReady($(Session.class));
}
});
}
}