PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/protocols/ss7/m3ua/impl/src/main/java/org/mobicents/protocols/ss7/m3ua/impl/tcp/TcpProvider.java

http://mobicents.googlecode.com/
Java | 108 lines | 36 code | 14 blank | 58 comment | 0 complexity | cbff3f5175e0a3d714a1e4b5a0cd8f56 MD5 | raw file
  1/*
  2 * JBoss, Home of Professional Open Source
  3 * Copyright 2011, Red Hat, Inc. and individual contributors
  4 * by the @authors tag. See the copyright.txt in the distribution for a
  5 * full listing of individual contributors.
  6 *
  7 * This is free software; you can redistribute it and/or modify it
  8 * under the terms of the GNU Lesser General Public License as
  9 * published by the Free Software Foundation; either version 2.1 of
 10 * the License, or (at your option) any later version.
 11 *
 12 * This software is distributed in the hope that it will be useful,
 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 15 * Lesser General Public License for more details.
 16 *
 17 * You should have received a copy of the GNU Lesser General Public
 18 * License along with this software; if not, write to the Free
 19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 21 */
 22
 23package org.mobicents.protocols.ss7.m3ua.impl.tcp;
 24
 25import java.io.IOException;
 26import org.mobicents.protocols.ss7.m3ua.M3UAChannel;
 27import org.mobicents.protocols.ss7.m3ua.M3UAProvider;
 28import org.mobicents.protocols.ss7.m3ua.M3UASelector;
 29import org.mobicents.protocols.ss7.m3ua.M3UAServerChannel;
 30import org.mobicents.protocols.ss7.m3ua.impl.M3UASelectorImpl;
 31import org.mobicents.protocols.ss7.m3ua.message.MessageFactory;
 32import org.mobicents.protocols.ss7.m3ua.impl.message.MessageFactoryImpl;
 33import org.mobicents.protocols.ss7.m3ua.parameter.ParameterFactory;
 34import org.mobicents.protocols.ss7.m3ua.impl.parameter.ParameterFactoryImpl;
 35
 36/**
 37 * Implements M3UAProvider for TCP/IP undelying network.
 38 * 
 39 * @author amit bhayani
 40 * @author kulikov
 41 */
 42public class TcpProvider implements M3UAProvider {
 43
 44    static private TcpProvider provider = new TcpProvider();
 45
 46    private MessageFactoryImpl msgFactory = new MessageFactoryImpl();
 47    private ParameterFactoryImpl paramFactory = new ParameterFactoryImpl();
 48
 49    private TcpProvider() {
 50
 51    }
 52
 53    /**
 54     * Returns the system-wide default selector provider for this invocation of
 55     * the Java virtual machine.
 56     * 
 57     * @return
 58     */
 59    public static M3UAProvider provider() {
 60        return provider;
 61    }
 62
 63    /**
 64     * (Non Java-doc.)
 65     * 
 66     * @see org.mobicents.protocols.ss7.m3ua.M3UAProvider#openChannel()
 67     */
 68    public M3UAChannel openChannel() throws IOException {
 69        return TcpChannel.open(this);
 70    }
 71
 72    /**
 73     * (Non Java-doc.)
 74     * 
 75     * @see org.mobicents.protocols.ss7.m3ua.M3UAProvider#openServerChannel()
 76     */
 77    public M3UAServerChannel openServerChannel() throws IOException {
 78        return TcpServerChannel.open(this);
 79    }
 80
 81    /**
 82     * (Non Java-doc.)
 83     * 
 84     * @see org.mobicents.protocols.ss7.m3ua.M3UAProvider#openServerChannel()
 85     */
 86    public M3UASelector openSelector() throws IOException {
 87        return M3UASelectorImpl.open();
 88    }
 89
 90    /**
 91     * (Non Java-doc.)
 92     * 
 93     * @see org.mobicents.protocols.ss7.m3ua.M3UAProvider#getMessageFactory()
 94     */
 95    public MessageFactory getMessageFactory() {
 96        return msgFactory;
 97    }
 98
 99    /**
100     * (Non Java-doc.)
101     * 
102     * @see org.mobicents.protocols.ss7.m3ua.M3UAProvider#getParameterFactory()
103     */
104    public ParameterFactory getParameterFactory() {
105        return paramFactory;
106    }
107
108}