Return-Path: X-Original-To: apmail-jclouds-user-archive@minotaur.apache.org Delivered-To: apmail-jclouds-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3634C1841F for ; Thu, 24 Dec 2015 09:16:30 +0000 (UTC) Received: (qmail 68094 invoked by uid 500); 24 Dec 2015 09:16:17 -0000 Delivered-To: apmail-jclouds-user-archive@jclouds.apache.org Received: (qmail 68012 invoked by uid 500); 24 Dec 2015 09:16:17 -0000 Mailing-List: contact user-help@jclouds.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@jclouds.apache.org Delivered-To: mailing list user@jclouds.apache.org Received: (qmail 68003 invoked by uid 99); 24 Dec 2015 09:16:17 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Dec 2015 09:16:17 +0000 Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id D719F1A041D for ; Thu, 24 Dec 2015 09:16:16 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id l126so175679009wml.0 for ; Thu, 24 Dec 2015 01:16:16 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.28.16.72 with SMTP id 69mr40742275wmq.100.1450948575565; Thu, 24 Dec 2015 01:16:15 -0800 (PST) Received: by 10.28.223.137 with HTTP; Thu, 24 Dec 2015 01:16:15 -0800 (PST) Received: by 10.28.223.137 with HTTP; Thu, 24 Dec 2015 01:16:15 -0800 (PST) In-Reply-To: References: Date: Thu, 24 Dec 2015 10:16:15 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Is SwiftApi is thread safe? From: Ignasi Barrera To: user@jclouds.apache.org Content-Type: multipart/alternative; boundary=001a114713466f26940527a14ab8 --001a114713466f26940527a14ab8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi! It should be thread-safe, so you should be able to reuse it. Just take into account that you'll have to close it when you're done. I. El 22/12/2015 6:23, "Kiran Singh" escribi=C3=B3: > Hi > > My name is Kiran Singh and i am using jCloud openstacks-swift library to > connect with Swift server. I want to write a multi-threaded application. > > For making connection to swift server i am using following code: > > SwiftApi swiftApi =3D ContextBuilder.newBuilder(provider) > .endpoint(endUrl) > .credentials(identity, credential) > .buildApi(SwiftApi.class); > > My question is SwiftApi is thread safe? > > Can i use Singleton object of swiftApi for each thread or do i need to > create swiftApi object for each thread? > > Thanks in advance > Kiran Singh > --001a114713466f26940527a14ab8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi!

It should be thread-safe, so you should be able to reuse it.= Just take into account that you'll have to close it when you're do= ne.

I.

El 22/12/2015 6:23, "Kiran Singh" <= kim.singh15@gmail.com> escr= ibi=C3=B3:
Hi

My name is Kiran Sin= gh and i am using jCloud openstacks-swift library to connect with Swift ser= ver. I want to write a multi-threaded application.

For making = connection to swift server i am using following code:

SwiftApi swift= Api =3D ContextBuilder.newBuilder(provider)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .endpoint(endUrl)
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .cred= entials(identity, credential)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 .buildApi(SwiftApi.class);

= My question is SwiftApi is thread safe?

Can i use Singleton ob= ject of swiftApi for each thread or do i need to create swiftApi object for= each thread?

Thanks in advance
Kiran Singh
--001a114713466f26940527a14ab8--