summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ObjectAdapterI.cpp
blob: 5504ded919e38c5de85526f79e2c3c0dd168fb64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
// **********************************************************************
//
// Copyright (c) 2002
// ZeroC, Inc.
// Billerica, MA, USA
//
// All Rights Reserved.
//
// Ice is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License version 2 as published by
// the Free Software Foundation.
//
// **********************************************************************

#include <IceUtil/UUID.h>
#include <Ice/ObjectAdapterI.h>
#include <Ice/ServantLocator.h>
#include <Ice/Instance.h>
#include <Ice/Proxy.h>
#include <Ice/ProxyFactory.h>
#include <Ice/ReferenceFactory.h>
#include <Ice/Endpoint.h>
#include <Ice/EndpointFactoryManager.h>
#include <Ice/ConnectionFactory.h>
#include <Ice/RouterInfo.h>
#include <Ice/LocalException.h>
#include <Ice/Properties.h>
#include <Ice/Functional.h>
#include <Ice/LocatorInfo.h>
#include <Ice/Locator.h>
#include <Ice/LoggerUtil.h>

#ifdef _WIN32
#   include <sys/timeb.h>
#else
#   include <sys/time.h>
#endif

using namespace std;
using namespace Ice;
using namespace IceInternal;

CommunicatorPtr
Ice::ObjectAdapterI::getCommunicator()
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    return _communicator;
}

void
Ice::ObjectAdapterI::activate()
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }
    
    if(!_printAdapterReadyDone)
    {
	if(_locatorInfo && !_id.empty())
	{
	    Identity ident;
	    ident.name = "dummy";
	    
	    //
	    // TODO: This might throw if we can't connect to the
	    // locator. Shall we raise a special exception for the
	    // activate operation instead of a non obvious network
	    // exception?
	    //
	    try
	    {
		_locatorInfo->getLocatorRegistry()->setAdapterDirectProxy(_id, newDirectProxy(ident));
	    }
	    catch(const Ice::AdapterNotRegisteredException&)
	    {
		ObjectAdapterNotRegisteredException ex(__FILE__, __LINE__);
		ex.name = _name;
		throw ex;
	    }
	    catch(const Ice::AdapterAlreadyActiveException&)
	    {
		ObjectAdapterIdInUseException ex(__FILE__, __LINE__);
		ex.id = _id;
		ex.name = _name;
		throw ex;
	    }
	}
    }

    for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
	     Ice::voidMemFun(&IncomingConnectionFactory::activate));

    if(!_printAdapterReadyDone)
    {
	if(_instance->properties()->getPropertyAsInt("Ice.PrintAdapterReady") > 0)
	{
	    cout << _name << " ready" << endl;
	}
	
	_printAdapterReadyDone = true;
    }
}

void
Ice::ObjectAdapterI::hold()
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }
	
    for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
	     Ice::voidMemFun(&IncomingConnectionFactory::hold));
}
    
void
Ice::ObjectAdapterI::deactivate()
{
    {
	IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
	
	if(!_instance)
	{
	    //
	    // Ignore deactivation requests if the Object Adapter has
	    // already been deactivated.
	    //
	    return;
	}
	
	for_each(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(),
		 Ice::voidMemFun(&IncomingConnectionFactory::destroy));
	_incomingConnectionFactories.clear();
	
	_instance->outgoingConnectionFactory()->removeAdapter(this);

	_instance = 0;
	_communicator = 0;
    }

    decUsageCount();
}

void
Ice::ObjectAdapterI::waitForDeactivate()
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    assert(_usageCount >= 0);

    while(_usageCount > 0)
    {
	wait();
    }

    assert(_usageCount == 0);
}

ObjectPrx
Ice::ObjectAdapterI::add(const ObjectPtr& object, const Identity& ident)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    checkIdentity(ident);

    _activeServantMapHint = _activeServantMap.insert(_activeServantMapHint, make_pair(ident, object));

    return newProxy(ident);
}

ObjectPrx
Ice::ObjectAdapterI::addWithUUID(const ObjectPtr& object)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    Identity ident;
    ident.name = IceUtil::generateUUID();

    _activeServantMapHint = _activeServantMap.insert(_activeServantMapHint, make_pair(ident, object));

    return newProxy(ident);
}

void
Ice::ObjectAdapterI::remove(const Identity& ident)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    checkIdentity(ident);

    _activeServantMap.erase(ident);
    _activeServantMapHint = _activeServantMap.end();
}

void
Ice::ObjectAdapterI::addServantLocator(const ServantLocatorPtr& locator, const string& prefix)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    _locatorMapHint = _locatorMap.insert(_locatorMapHint, make_pair(prefix, locator));
}

void
Ice::ObjectAdapterI::removeServantLocator(const string& prefix)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    map<string, ServantLocatorPtr>::iterator p = _locatorMap.end();
    
    if(_locatorMapHint != _locatorMap.end())
    {
	if(_locatorMapHint->first == prefix)
	{
	    p = _locatorMapHint;
	}
    }
    
    if(p == _locatorMap.end())
    {
	p = _locatorMap.find(prefix);
    }
    
    if(p != _locatorMap.end())
    {
	p->second->deactivate();

	if(p == _locatorMapHint)
	{
	    _locatorMap.erase(p++);
	    _locatorMapHint = p;
	}
	else
	{
	    _locatorMap.erase(p);
	}
    }
}

ServantLocatorPtr
Ice::ObjectAdapterI::findServantLocator(const string& prefix)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
    
    //
    // Don't check whether deactivation has been initiated. This
    // operation might be called (e.g., from Incoming or Direct)
    // after deactivation has been initiated, but before
    // deactivation has been completed.
    //
    /*
    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }
    */

    map<string, ServantLocatorPtr>::iterator p = _locatorMap.end();
    
    if(_locatorMapHint != _locatorMap.end())
    {
	if(_locatorMapHint->first == prefix)
	{
	    p = _locatorMapHint;
	}
    }
    
    if(p == _locatorMap.end())
    {
	p = _locatorMap.find(prefix);
    }
    
    if(p != _locatorMap.end())
    {
	_locatorMapHint = p;
	return p->second;
    }
    else
    {
	return 0;
    }
}

ObjectPtr
Ice::ObjectAdapterI::identityToServant(const Identity& ident)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    //
    // Don't check whether deactivation has been initiated. This
    // operation might be called (e.g., from Incoming or Direct)
    // after deactivation has been initiated, but before
    // deactivation has been completed.
    //
    /*
    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }
    */
    
    //
    // Don't call checkIdentity. We simply want null to be
    // returned (e.g., for Direct, Incoming) in case the identity
    // is incorrect and therefore no servant can be found.
    //
    /*
    checkIdentity(ident);
    */

    if(_activeServantMapHint != _activeServantMap.end())
    {
	if(_activeServantMapHint->first == ident)
	{
	    return _activeServantMapHint->second;
	}
    }
    
    ObjectDict::iterator p = _activeServantMap.find(ident);
    if(p != _activeServantMap.end())
    {
	_activeServantMapHint = p;
	return p->second;
    }
    else
    {
	return 0;
    }
}

ObjectPtr
Ice::ObjectAdapterI::proxyToServant(const ObjectPrx& proxy)
{
    ReferencePtr ref = proxy->__reference();
    return identityToServant(ref->identity);
}

ObjectPrx
Ice::ObjectAdapterI::createProxy(const Identity& ident)
{
    checkIdentity(ident);

    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
    
    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }
    
    return newProxy(ident);
}

ObjectPrx
Ice::ObjectAdapterI::createDirectProxy(const Identity& ident)
{
    checkIdentity(ident);

    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
    
    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }
    
    return newDirectProxy(ident);
}

ObjectPrx
Ice::ObjectAdapterI::createReverseProxy(const Identity& ident)
{
    checkIdentity(ident);

    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
    
    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }
    
    //
    // Create a reference and return a reverse proxy for this reference.
    //
    vector<EndpointPtr> endpoints;
    ReferencePtr ref = _instance->referenceFactory()->create(ident, vector<string>(), Reference::ModeTwoway,
							     false, false, "", endpoints, 0, 0, this);
    return _instance->proxyFactory()->referenceToProxy(ref);
}

void
Ice::ObjectAdapterI::addRouter(const RouterPrx& router)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
    
    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    RouterInfoPtr routerInfo = _instance->routerManager()->get(router);
    if(routerInfo)
    {
	//
	// Add the router's server proxy endpoints to this object
	// adapter.
	//
	ObjectPrx proxy = routerInfo->getServerProxy();

	{
	    IceUtil::Mutex::Lock routerEndpointsSync(_routerEndpointsMutex);
	    copy(proxy->__reference()->endpoints.begin(), proxy->__reference()->endpoints.end(),
		 back_inserter(_routerEndpoints));
	    sort(_routerEndpoints.begin(), _routerEndpoints.end()); // Must be sorted.
	    _routerEndpoints.erase(unique(_routerEndpoints.begin(), _routerEndpoints.end()), _routerEndpoints.end());
	}

	//
	// Associate this object adapter with the router. This way,
	// new outgoing connections to the router's client proxy will
	// use this object adapter for callbacks.
	//
	routerInfo->setAdapter(this);

	//
	// Also modify all existing outgoing connections to the
	// router's client proxy to use this object adapter for
	// callbacks.
	//	
	_instance->outgoingConnectionFactory()->setRouter(routerInfo->getRouter());
    }
}

void
Ice::ObjectAdapterI::setLocator(const LocatorPrx& locator)
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
    
    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    _locatorInfo = _instance->locatorManager()->get(locator);
}

list<ConnectionPtr>
Ice::ObjectAdapterI::getIncomingConnections() const
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(!_instance)
    {
	ObjectAdapterDeactivatedException ex(__FILE__, __LINE__);
	ex.name = _name;
	throw ex;
    }

    list<ConnectionPtr> connections;
    vector<IncomingConnectionFactoryPtr>::const_iterator p;
    for(p = _incomingConnectionFactories.begin(); p != _incomingConnectionFactories.end(); ++p)
    {
	list<ConnectionPtr> cons = (*p)->connections();
	connections.splice(connections.end(), cons);
    }
    return connections;
}

void
Ice::ObjectAdapterI::incUsageCount()
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
 
    //
    // Don't check whether deactivation has been initiated. This
    // operation might be called (e.g., from Incoming or Direct)
    // after deactivation has been initiated, but before
    // deactivation has been completed.
    //
    /*
    assert(_instance);
    */
    assert(_usageCount >= 0);
    ++_usageCount;
}

void
Ice::ObjectAdapterI::decUsageCount()
{
    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    //
    // The object adapter may already be deactivated when the usage
    // count is decremented, thus no check for prior deactivation,
    // i.e., no assert(_instance).
    //

    assert(_usageCount > 0);
    --_usageCount;
    if(_usageCount == 0)
    {
	_activeServantMap.clear();
	_activeServantMapHint = _activeServantMap.end();

        std::map<std::string, ServantLocatorPtr>::iterator p;
        for(p = _locatorMap.begin(); p != _locatorMap.end(); ++p)
        {
            try
            {
                p->second->deactivate();
            }
            catch(const Exception& ex)
            {
                Error out(_logger);
                out << "exception during locator deactivation:\n"
                    << "object adapter: `" << _name << "'\n"
                    << "locator prefix: `" << p->first << "'\n"
                    << ex;
            }
            catch(...)
            {
                Error out(_logger);
                out << "unknown exception during locator deactivation:\n"
                    << "object adapter: `" << _name << "'\n"
                    << "locator prefix: `" << p->first << "'";
            }
        }
//	for_each(_locatorMap.begin(), _locatorMap.end(),
//		 Ice::secondVoidMemFun<string, ServantLocator>(&ServantLocator::deactivate));
	_locatorMap.clear();
	_locatorMapHint = _locatorMap.end();
        _logger = 0;

	notifyAll();
    }
}

Ice::ObjectAdapterI::ObjectAdapterI(const InstancePtr& instance, const CommunicatorPtr& communicator,
				    const string& name, const string& endpts, const string& id) :
    _instance(instance),
    _communicator(communicator),
    _printAdapterReadyDone(false),
    _name(name),
    _id(id),
    _logger(instance->logger()),
    _activeServantMapHint(_activeServantMap.end()),
    _locatorMapHint(_locatorMap.end()),
    _usageCount(1)
{
    string s(endpts);
    transform(s.begin(), s.end(), s.begin(), ::tolower);

    __setNoDelete(true);
    try
    {
	string::size_type beg;
	string::size_type end = 0;

	while(end < s.length())
	{
	    const string delim = " \t\n\r";
	    
	    beg = s.find_first_not_of(delim, end);
	    if(beg == string::npos)
	    {
		break;
	    }

	    end = s.find(':', beg);
	    if(end == string::npos)
	    {
		end = s.length();
	    }
	    
	    if(end == beg)
	    {
		break;
	    }
	    
	    string es = s.substr(beg, end - beg);
	   
	    //
	    // Don't store the endpoint in the adapter. The Collector
	    // might change it, for example, to fill in the real port
	    // number if a zero port number is given.
	    //
	    EndpointPtr endp = _instance->endpointFactoryManager()->create(es);
	    _incomingConnectionFactories.push_back(new IncomingConnectionFactory(instance, endp, this));

	    end = end + 1;
	}
    }
    catch(...)
    {
	deactivate();
	__setNoDelete(false);
	throw;
    }
    __setNoDelete(false);  
}

Ice::ObjectAdapterI::~ObjectAdapterI()
{
    assert(_usageCount == 0);

    if(_instance)
    {
	Warning out(_instance->logger());
	out << "object adapter has not been deactivated";
    }
}

ObjectPrx
Ice::ObjectAdapterI::newProxy(const Identity& ident) const
{
    if(_id.empty())
    {
	return newDirectProxy(ident);
    }
    else
    {
	//
	// Create a reference with the adapter id.
	//
	vector<EndpointPtr> endpoints;
	ReferencePtr ref = _instance->referenceFactory()->create(ident, vector<string>(), Reference::ModeTwoway,
								 false, false, _id, endpoints, 0, 0, 0);

	//
	// Return a proxy for the reference. 
	//
	return _instance->proxyFactory()->referenceToProxy(ref);
    }
}

ObjectPrx
Ice::ObjectAdapterI::newDirectProxy(const Identity& ident) const
{
    vector<EndpointPtr> endpoints;

    // 
    // First we add all endpoints from all incoming connection
    // factories.
    //
    transform(_incomingConnectionFactories.begin(), _incomingConnectionFactories.end(), back_inserter(endpoints),
	      Ice::constMemFun(&IncomingConnectionFactory::endpoint));
    
    //
    // Now we also add the endpoints of the router's server proxy, if
    // any. This way, object references created by this object adapter
    // will also point to the router's server proxy endpoints.
    //
    {
	IceUtil::Mutex::Lock routerEndpointsSync(_routerEndpointsMutex);
	copy(_routerEndpoints.begin(), _routerEndpoints.end(), back_inserter(endpoints));
    }
    
    //
    // Create a reference and return a proxy for this reference.
    //
    ReferencePtr ref = _instance->referenceFactory()->create(ident, vector<string>(), Reference::ModeTwoway,
							     false, false, "", endpoints, 0, 0, 0);
    return _instance->proxyFactory()->referenceToProxy(ref);

}

void
Ice::ObjectAdapterI::checkIdentity(const Identity& ident)
{
    if(ident.name.size() == 0)
    {
        IllegalIdentityException e(__FILE__, __LINE__);
        e.id = ident;
        throw e;
    }
}

bool
Ice::ObjectAdapterI::isLocal(const ObjectPrx& proxy) const
{
    ReferencePtr ref = proxy->__reference();
    vector<EndpointPtr>::const_iterator p;

    if(!ref->adapterId.empty())
    {
	//
	// Proxy is local if the reference adapter id matches this
	// adapter id.
	//
	return ref->adapterId == _id;
    }

    //
    // Proxies which have at least one endpoint in common with the
    // endpoints used by this object adapter's incoming connection
    // factories are considered local.
    //
    for(p = ref->endpoints.begin(); p != ref->endpoints.end(); ++p)
    {
	vector<IncomingConnectionFactoryPtr>::const_iterator q;
	for(q = _incomingConnectionFactories.begin(); q != _incomingConnectionFactories.end(); ++q)
	{
	    if((*q)->equivalent(*p))
	    {
		return true;
	    }
	}
    }

    {
	IceUtil::Mutex::Lock routerEndpointsSync(_routerEndpointsMutex);
	
	//
	// Proxies which have at least one endpoint in common with the
	// router's server proxy endpoints (if any), are also considered
	// local.
	//
	for(p = ref->endpoints.begin(); p != ref->endpoints.end(); ++p)
	{
	    if(binary_search(_routerEndpoints.begin(), _routerEndpoints.end(), *p)) // _routerEndpoints is sorted.
	    {
		return true;
	    }
	}
    }
	
    return false;
}