Search in sources :

Example 1 with ObjectInUseException

use of javax.sip.ObjectInUseException in project XobotOS by xamarin.

the class SipProviderImpl method removeListeningPoint.

/*
     * (non-Javadoc)
     *
     * @see javax.sip.SipProvider#removeListeningPoint(javax.sip.ListeningPoint)
     */
public synchronized void removeListeningPoint(ListeningPoint listeningPoint) throws ObjectInUseException {
    ListeningPointImpl lp = (ListeningPointImpl) listeningPoint;
    if (lp.messageProcessor.inUse())
        throw new ObjectInUseException("Object is in use");
    this.listeningPoints.remove(lp.getTransport().toUpperCase());
}
Also used : ObjectInUseException(javax.sip.ObjectInUseException)

Example 2 with ObjectInUseException

use of javax.sip.ObjectInUseException in project XobotOS by xamarin.

the class SipProviderImpl method addListeningPoint.

/*
     * (non-Javadoc)
     *
     * @see javax.sip.SipProvider#addListeningPoint(javax.sip.ListeningPoint)
     */
public synchronized void addListeningPoint(ListeningPoint listeningPoint) throws ObjectInUseException {
    ListeningPointImpl lp = (ListeningPointImpl) listeningPoint;
    if (lp.sipProvider != null && lp.sipProvider != this)
        throw new ObjectInUseException("Listening point assigned to another provider");
    String transport = lp.getTransport().toUpperCase();
    if (this.listeningPoints.isEmpty()) {
        // first one -- record the IP address/port of the LP
        this.address = listeningPoint.getIPAddress();
        this.port = listeningPoint.getPort();
    } else {
        if ((!this.address.equals(listeningPoint.getIPAddress())) || this.port != listeningPoint.getPort())
            throw new ObjectInUseException("Provider already has different IP Address associated");
    }
    if (this.listeningPoints.containsKey(transport) && this.listeningPoints.get(transport) != listeningPoint)
        throw new ObjectInUseException("Listening point already assigned for transport!");
    // This is for backwards compatibility.
    lp.sipProvider = this;
    this.listeningPoints.put(transport, lp);
}
Also used : ObjectInUseException(javax.sip.ObjectInUseException)

Example 3 with ObjectInUseException

use of javax.sip.ObjectInUseException in project XobotOS by xamarin.

the class SipStackImpl method createSipProvider.

/*
	 * (non-Javadoc)
	 * 
	 * @see javax.sip.SipStack#createSipProvider(javax.sip.ListeningPoint)
	 */
public SipProvider createSipProvider(ListeningPoint listeningPoint) throws ObjectInUseException {
    if (listeningPoint == null)
        throw new NullPointerException("null listeningPoint");
    if (this.isLoggingEnabled())
        this.getStackLogger().logDebug("createSipProvider: " + listeningPoint);
    ListeningPointImpl listeningPointImpl = (ListeningPointImpl) listeningPoint;
    if (listeningPointImpl.sipProvider != null)
        throw new ObjectInUseException("Provider already attached!");
    SipProviderImpl provider = new SipProviderImpl(this);
    provider.setListeningPoint(listeningPointImpl);
    listeningPointImpl.sipProvider = provider;
    this.sipProviders.add(provider);
    return provider;
}
Also used : ObjectInUseException(javax.sip.ObjectInUseException)

Aggregations

ObjectInUseException (javax.sip.ObjectInUseException)3