1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
11 #include <IceBox/IceBox.h>
12 #include <Freeze/Freeze.h>
18 class ServiceI
: public ::IceBox::Service
25 virtual void start(const string
&,
26 const CommunicatorPtr
&,
38 ICE_DECLSPEC_EXPORT ::IceBox::Service
*
39 create(CommunicatorPtr communicator
)
55 ServiceI::start(const string
& name
,
56 const CommunicatorPtr
& communicator
,
57 const StringSeq
& args
)
59 Ice::PropertiesPtr properties
= communicator
->getProperties();
60 Ice::ObjectAdapterPtr adapter
= communicator
->createObjectAdapter(name
);
61 if(properties
->getPropertyAsInt(name
+ ".Freeze") > 0)
64 // We do this to ensure the dbenv directory exists.
66 Freeze::createConnection(communicator
, name
);
68 Ice::ObjectPtr object
= new TestI(properties
);
69 adapter
->add(object
, communicator
->stringToIdentity(properties
->getProperty(name
+ ".Identity")));