1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_framework.hxx" 30 31 //________________________________ 32 // my own includes 33 #include <jobs/joburl.hxx> 34 #include <threadhelp/readguard.hxx> 35 #include <threadhelp/writeguard.hxx> 36 #include <general.h> 37 38 //________________________________ 39 // interface includes 40 41 //________________________________ 42 // includes of other projects 43 #include <rtl/ustrbuf.hxx> 44 #include <vcl/svapp.hxx> 45 46 //________________________________ 47 // namespace 48 49 namespace framework{ 50 51 //________________________________ 52 // non exported const 53 54 //________________________________ 55 // non exported definitions 56 57 //________________________________ 58 // declarations 59 60 //________________________________ 61 /** 62 @short special ctor 63 @descr It initialize this new instance with a (hopyfully) valid job URL. 64 This URL will be parsed. After that we set our members right, 65 so other interface methods of this class can be used to get 66 all items of this URL. Of course it will be possible to know, 67 if this URL was valid too. 68 69 @param sURL 70 the job URL for parsing 71 */ 72 JobURL::JobURL( /*IN*/ const ::rtl::OUString& sURL ) 73 : ThreadHelpBase( &Application::GetSolarMutex() ) 74 { 75 #ifdef ENABLE_COMPONENT_SELF_CHECK 76 JobURL::impldbg_checkIt(); 77 #endif 78 79 m_eRequest = E_UNKNOWN; 80 81 // syntax: vnd.sun.star.job:{[event=<name>],[alias=<name>],[service=<name>]} 82 83 // check for "vnd.sun.star.job:" 84 if (sURL.matchIgnoreAsciiCaseAsciiL(JOBURL_PROTOCOL_STR,JOBURL_PROTOCOL_LEN,0)) 85 { 86 sal_Int32 t = JOBURL_PROTOCOL_LEN; 87 do 88 { 89 // seperate all token of "{[event=<name>],[alias=<name>],[service=<name>]}" 90 ::rtl::OUString sToken = sURL.getToken(0, JOBURL_PART_SEPERATOR, t); 91 ::rtl::OUString sPartValue ; 92 ::rtl::OUString sPartArguments; 93 94 // check for "event=" 95 if ( 96 (JobURL::implst_split(sToken,JOBURL_EVENT_STR,JOBURL_EVENT_LEN,sPartValue,sPartArguments)) && 97 (sPartValue.getLength()>0 ) 98 ) 99 { 100 // set the part value 101 m_sEvent = sPartValue ; 102 m_sEventArgs = sPartArguments; 103 m_eRequest |= E_EVENT ; 104 } 105 else 106 // check for "alias=" 107 if ( 108 (JobURL::implst_split(sToken,JOBURL_ALIAS_STR,JOBURL_ALIAS_LEN,sPartValue,sPartArguments)) && 109 (sPartValue.getLength()>0 ) 110 ) 111 { 112 // set the part value 113 m_sAlias = sPartValue ; 114 m_sAliasArgs = sPartArguments; 115 m_eRequest |= E_ALIAS ; 116 } 117 else 118 // check for "service=" 119 if ( 120 (JobURL::implst_split(sToken,JOBURL_SERVICE_STR,JOBURL_SERVICE_LEN,sPartValue,sPartArguments)) && 121 (sPartValue.getLength()>0 ) 122 ) 123 { 124 // set the part value 125 m_sService = sPartValue ; 126 m_sServiceArgs = sPartArguments; 127 m_eRequest |= E_SERVICE ; 128 } 129 } 130 while(t!=-1); 131 } 132 } 133 134 //________________________________ 135 /** 136 @short knows, if this job URL object hold a valid URL inside 137 138 @return <TRUE/> if it represent a valid job URL. 139 */ 140 sal_Bool JobURL::isValid() const 141 { 142 /* SAFE { */ 143 ReadGuard aReadLock(m_aLock); 144 return (m_eRequest!=E_UNKNOWN); 145 } 146 147 //________________________________ 148 /** 149 @short get the event item of this job URL 150 @descr Because the three possible parts of such URL (event, alias, service) 151 can't be combined, this method can(!) return a valid value - but it's 152 not a must. Thats why the return value must be used too, to detect a missing 153 event value. 154 155 @param sEvent 156 returns the possible existing event value 157 e.g. "vnd.sun.star.job:event=myEvent" returns "myEvent" 158 159 @return <TRUE/> if an event part of the job URL exist and the out parameter 160 sEvent was filled. 161 162 @attention The out parameter will be reseted everytime. Don't use it if method returns <FALSE/>! 163 */ 164 sal_Bool JobURL::getEvent( /*OUT*/ ::rtl::OUString& sEvent ) const 165 { 166 /* SAFE { */ 167 ReadGuard aReadLock(m_aLock); 168 169 sEvent = ::rtl::OUString(); 170 sal_Bool bSet = ((m_eRequest & E_EVENT) == E_EVENT); 171 if (bSet) 172 sEvent = m_sEvent; 173 174 aReadLock.unlock(); 175 /* } SAFE */ 176 177 return bSet; 178 } 179 180 //________________________________ 181 /** 182 @short get the alias item of this job URL 183 @descr Because the three possible parts of such URL (event, alias, service) 184 can't be combined, this method can(!) return a valid value - but it's 185 not a must. Thats why the return value must be used too, to detect a missing 186 alias value. 187 188 @param sAlias 189 returns the possible existing alias value 190 e.g. "vnd.sun.star.job:alias=myAlias" returns "myAlias" 191 192 @return <TRUE/> if an alias part of the job URL exist and the out parameter 193 sAlias was filled. 194 195 @attention The out parameter will be reseted everytime. Don't use it if method returns <FALSE/>! 196 */ 197 sal_Bool JobURL::getAlias( /*OUT*/ ::rtl::OUString& sAlias ) const 198 { 199 /* SAFE { */ 200 ReadGuard aReadLock(m_aLock); 201 202 sAlias = ::rtl::OUString(); 203 sal_Bool bSet = ((m_eRequest & E_ALIAS) == E_ALIAS); 204 if (bSet) 205 sAlias = m_sAlias; 206 207 aReadLock.unlock(); 208 /* } SAFE */ 209 210 return bSet; 211 } 212 213 //________________________________ 214 /** 215 @short get the service item of this job URL 216 @descr Because the three possible parts of such URL (event, service, service) 217 can't be combined, this method can(!) return a valid value - but it's 218 not a must. Thats why the return value must be used too, to detect a missing 219 service value. 220 221 @param sAlias 222 returns the possible existing service value 223 e.g. "vnd.sun.star.job:service=com.sun.star.Service" returns "com.sun.star.Service" 224 225 @return <TRUE/> if an service part of the job URL exist and the out parameter 226 sService was filled. 227 228 @attention The out parameter will be reseted everytime. Don't use it if method returns <FALSE/>! 229 */ 230 sal_Bool JobURL::getService( /*OUT*/ ::rtl::OUString& sService ) const 231 { 232 /* SAFE { */ 233 ReadGuard aReadLock(m_aLock); 234 235 sService = ::rtl::OUString(); 236 sal_Bool bSet = ((m_eRequest & E_SERVICE) == E_SERVICE); 237 if (bSet) 238 sService = m_sService; 239 240 aReadLock.unlock(); 241 /* } SAFE */ 242 243 return bSet; 244 } 245 246 //________________________________ 247 /** 248 @short searches for a special identifier in the given string and split it 249 @descr If the given identifier could be found at the beginning of the given string, 250 this method split it into different parts and return it. 251 Following schema is used: <partidentifier>=<partvalue>[?<partarguments>] 252 253 @param sPart 254 the string, which should be analyzed 255 256 @param pPartIdentifier 257 the part identifier value, which must be found at the beginning of the 258 parameter <var>sPart</var> 259 260 @param nPartLength 261 the length of the ascii value <var>pPartIdentifier</var> 262 263 @param rPartValue 264 returns the part value if <var>sPart</var> was splitted successfully 265 266 @param rPartArguments 267 returns the part arguments if <var>sPart</var> was splitted successfully 268 269 @return <TRUE/> if the identifier could be found and the string was splitted. 270 <FALSE/> otherwhise. 271 */ 272 sal_Bool JobURL::implst_split( /*IN*/ const ::rtl::OUString& sPart , 273 /*IN*/ const sal_Char* pPartIdentifier , 274 /*IN*/ sal_Int32 nPartLength , 275 /*OUT*/ ::rtl::OUString& rPartValue , 276 /*OUT*/ ::rtl::OUString& rPartArguments ) 277 { 278 // first search for the given identifier 279 sal_Bool bPartFound = (sPart.matchIgnoreAsciiCaseAsciiL(pPartIdentifier,nPartLength,0)); 280 281 // If it exist - we can split the part and return sal_True. 282 // Otherwhise we do nothing and return sal_False. 283 if (bPartFound) 284 { 285 // But may the part has optional arguments - seperated by a "?". 286 // Do so - we set the return value with the whole part string. 287 // Arguments will be set to an empty string as default. 288 // If we detect the right sign - we split the arguments and overwrite the default. 289 ::rtl::OUString sValueAndArguments = sPart.copy(nPartLength); 290 ::rtl::OUString sValue = sValueAndArguments ; 291 ::rtl::OUString sArguments; 292 293 sal_Int32 nArgStart = sValueAndArguments.indexOf('?',0); 294 if (nArgStart!=-1) 295 { 296 sValue = sValueAndArguments.copy(0,nArgStart); 297 ++nArgStart; // ignore '?'! 298 sArguments = sValueAndArguments.copy(nArgStart); 299 } 300 301 rPartValue = sValue ; 302 rPartArguments = sArguments; 303 } 304 305 return bPartFound; 306 } 307 308 //________________________________ 309 /** 310 @short special debug method 311 @descr It's the entry point method to start a self component check for this class. 312 It's used for internal purposes only and never a part of a legal product. 313 Use it for testing and debug only! 314 */ 315 #ifdef ENABLE_COMPONENT_SELF_CHECK 316 317 #define LOGFILE_JOBURL "joburl.log" 318 319 void JobURL::impldbg_checkIt() 320 { 321 // check simple URL's 322 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent" , E_EVENT , "onMyEvent", "" , "" , NULL, NULL, NULL); 323 JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias" , E_ALIAS , "" , "myAlias", "" , NULL, NULL, NULL); 324 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service", E_SERVICE, "" , "" , "css.Service", NULL, NULL, NULL); 325 JobURL::impldbg_checkURL("vnd.sun.star.job:service=;" , E_UNKNOWN, "" , "" , "" , NULL, NULL, NULL); 326 327 // check combinations 328 // Note: No additional spaces or tabs are allowed after a seperator occured. 329 // Tab and spaces before a seperator will be used as value! 330 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;alias=myAlias;service=css.Service" , E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL); 331 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service;alias=myAlias" , E_ALIAS | E_SERVICE , "" , "myAlias", "css.Service" , NULL, NULL, NULL); 332 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service ;alias=myAlias" , E_ALIAS | E_SERVICE , "" , "myAlias", "css.Service ", NULL, NULL, NULL); 333 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.Service; alias=myAlias" , E_UNKNOWN , "" , "" , "" , NULL, NULL, NULL); 334 JobURL::impldbg_checkURL("vnd.sun.star.job : event=onMyEvent" , E_UNKNOWN , "" , "" , "" , NULL, NULL, NULL); 335 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent;event=onMyEvent;service=css.Service", E_UNKNOWN , "" , "" , "" , NULL, NULL, NULL); 336 337 // check upper/lower case 338 // fix parts of the URL are case insensitive (e.g. "vnd.SUN.star.job:eVEnt=") 339 // values are case sensitive (e.g. "myAlias" ) 340 JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEvent;aliAs=myAlias;serVice=css.Service", E_EVENT | E_ALIAS | E_SERVICE , "onMyEvent", "myAlias", "css.Service" , NULL, NULL, NULL); 341 JobURL::impldbg_checkURL("vnd.SUN.star.job:eVEnt=onMyEVENT;aliAs=myALIAS;serVice=css.SERVICE", E_EVENT | E_ALIAS | E_SERVICE , "onMyEVENT", "myALIAS", "css.SERVICE" , NULL, NULL, NULL); 342 343 // check stupid URLs 344 JobURL::impldbg_checkURL("vnd.sun.star.jobs:service=css.Service" , E_UNKNOWN, "", "", "", NULL, NULL, NULL); 345 JobURL::impldbg_checkURL("vnd.sun.star.job service=css.Service" , E_UNKNOWN, "", "", "", NULL, NULL, NULL); 346 JobURL::impldbg_checkURL("vnd.sun.star.job:service;css.Service" , E_UNKNOWN, "", "", "", NULL, NULL, NULL); 347 JobURL::impldbg_checkURL("vnd.sun.star.job:service;" , E_UNKNOWN, "", "", "", NULL, NULL, NULL); 348 JobURL::impldbg_checkURL("vnd.sun.star.job:;alias;service;event=" , E_UNKNOWN, "", "", "", NULL, NULL, NULL); 349 JobURL::impldbg_checkURL("vnd.sun.star.job:alias=a;service=s;event=", E_UNKNOWN, "", "", "", NULL, NULL, NULL); 350 351 // check argument handling 352 JobURL::impldbg_checkURL("vnd.sun.star.job:event=onMyEvent?eventArg1,eventArg2=3,eventArg4," , E_EVENT , "onMyEvent", "" , "" , "eventArg1,eventArg2=3,eventArg4,", NULL , NULL ); 353 JobURL::impldbg_checkURL("vnd.sun.star.job:alias=myAlias?aliasArg1,aliasarg2" , E_EVENT , "" , "myAlias", "" , NULL , "aliasArg1,aliasarg2", NULL ); 354 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1" , E_EVENT , "" , "" , "css.myService", NULL , NULL , "serviceArg1" ); 355 JobURL::impldbg_checkURL("vnd.sun.star.job:service=css.myService?serviceArg1;alias=myAlias?aliasArg=564", E_EVENT | E_ALIAS, "" , "myAlias", "css.myService", NULL , "aliasArg=564" , "serviceArg1" ); 356 } 357 358 //________________________________ 359 /** 360 @short helper debug method 361 @descr It uses the given parameter to create a new instance of a JobURL. 362 They results will be compared with the exepected ones. 363 The a log will be written, which contains some detailed informations 364 for this sub test. 365 366 @param pURL 367 the job URL, which should be checked 368 369 @param eExpectedPart 370 the expected result 371 372 @param pExpectedEvent 373 the expected event value 374 375 @param pExpectedAlias 376 the expected alias value 377 378 @param pExpectedService 379 the expected service value 380 381 @param pExpectedEventArgs 382 the expected event arguments 383 384 @param pExpectedAliasArgs 385 the expected alias arguments 386 387 @param pExpectedServiceArgs 388 the expected service arguments 389 */ 390 void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL , 391 /*IN*/ sal_uInt32 eExpectedPart , 392 /*IN*/ const sal_Char* pExpectedEvent , 393 /*IN*/ const sal_Char* pExpectedAlias , 394 /*IN*/ const sal_Char* pExpectedService , 395 /*IN*/ const sal_Char* pExpectedEventArgs , 396 /*IN*/ const sal_Char* pExpectedAliasArgs , 397 /*IN*/ const sal_Char* pExpectedServiceArgs ) 398 { 399 ::rtl::OUString sEvent ; 400 ::rtl::OUString sAlias ; 401 ::rtl::OUString sService ; 402 ::rtl::OUString sEventArgs ; 403 ::rtl::OUString sAliasArgs ; 404 ::rtl::OUString sServiceArgs; 405 ::rtl::OUString sURL (::rtl::OUString::createFromAscii(pURL)); 406 sal_Bool bOK = sal_True; 407 408 JobURL aURL(sURL); 409 410 // check if URL is invalid 411 if (eExpectedPart==E_UNKNOWN) 412 bOK = !aURL.isValid(); 413 414 // check if URL has the expected event part 415 if ( 416 (bOK ) && 417 ((eExpectedPart & E_EVENT) == E_EVENT) 418 ) 419 { 420 bOK = ( 421 (aURL.isValid() ) && 422 (aURL.getEvent(sEvent) ) && 423 (sEvent.getLength()>0 ) && 424 (sEvent.compareToAscii(pExpectedEvent)==0) 425 ); 426 427 if (bOK && pExpectedEventArgs!=NULL) 428 { 429 bOK = ( 430 (aURL.getEventArgs(sEventArgs) ) && 431 (sEventArgs.compareToAscii(pExpectedEventArgs)==0) 432 ); 433 }; 434 } 435 436 // check if URL has no event part 437 if ( 438 (bOK ) && 439 ((eExpectedPart & E_EVENT) != E_EVENT) 440 ) 441 { 442 bOK = ( 443 (!aURL.getEvent(sEvent) ) && 444 (sEvent.getLength()==0 ) && 445 (!aURL.getEventArgs(sEventArgs)) && 446 (sEventArgs.getLength()==0 ) 447 ); 448 } 449 450 // check if URL has the expected alias part 451 if ( 452 (bOK ) && 453 ((eExpectedPart & E_ALIAS) == E_ALIAS) 454 ) 455 { 456 bOK = ( 457 (aURL.isValid() ) && 458 (aURL.getAlias(sAlias) ) && 459 (sAlias.getLength()>0 ) && 460 (sAlias.compareToAscii(pExpectedAlias)==0) 461 ); 462 463 if (bOK && pExpectedAliasArgs!=NULL) 464 { 465 bOK = ( 466 (aURL.getAliasArgs(sAliasArgs) ) && 467 (sAliasArgs.compareToAscii(pExpectedAliasArgs)==0) 468 ); 469 }; 470 } 471 472 // check if URL has the no alias part 473 if ( 474 (bOK ) && 475 ((eExpectedPart & E_ALIAS) != E_ALIAS) 476 ) 477 { 478 bOK = ( 479 (!aURL.getAlias(sAlias) ) && 480 (sAlias.getLength()==0 ) && 481 (!aURL.getAliasArgs(sAliasArgs)) && 482 (sAliasArgs.getLength()==0 ) 483 ); 484 } 485 486 // check if URL has the expected service part 487 if ( 488 (bOK ) && 489 ((eExpectedPart & E_SERVICE) == E_SERVICE) 490 ) 491 { 492 bOK = ( 493 (aURL.isValid() ) && 494 (aURL.getService(sService) ) && 495 (sService.getLength()>0 ) && 496 (sService.compareToAscii(pExpectedService)==0) 497 ); 498 499 if (bOK && pExpectedServiceArgs!=NULL) 500 { 501 bOK = ( 502 (aURL.getServiceArgs(sServiceArgs) ) && 503 (sServiceArgs.compareToAscii(pExpectedServiceArgs)==0) 504 ); 505 }; 506 } 507 508 // check if URL has the no service part 509 if ( 510 (bOK ) && 511 ((eExpectedPart & E_SERVICE) != E_SERVICE) 512 ) 513 { 514 bOK = ( 515 (!aURL.getService(sService) ) && 516 (sService.getLength()==0 ) && 517 (!aURL.getServiceArgs(sServiceArgs)) && 518 (sServiceArgs.getLength()==0 ) 519 ); 520 } 521 522 ::rtl::OUStringBuffer sMsg(256); 523 524 sMsg.appendAscii("\"" ); 525 sMsg.append (sURL ); 526 sMsg.appendAscii("\" "); 527 528 if (bOK) 529 { 530 sMsg.appendAscii("... OK\n"); 531 } 532 else 533 { 534 sMsg.appendAscii("... failed\n"); 535 sMsg.appendAscii("expected was: "); 536 if (eExpectedPart==E_UNKNOWN) 537 sMsg.appendAscii("E_UNKNOWN"); 538 if ((eExpectedPart & E_EVENT) == E_EVENT) 539 { 540 sMsg.appendAscii("| E_EVENT e=\""); 541 sMsg.appendAscii(pExpectedEvent ); 542 sMsg.appendAscii("\"" ); 543 } 544 if ((eExpectedPart & E_ALIAS) == E_ALIAS) 545 { 546 sMsg.appendAscii("| E_ALIAS a=\""); 547 sMsg.appendAscii(pExpectedAlias ); 548 sMsg.appendAscii("\"" ); 549 } 550 if ((eExpectedPart & E_SERVICE) == E_SERVICE) 551 { 552 sMsg.appendAscii("| E_SERVICE s=\""); 553 sMsg.appendAscii(pExpectedService ); 554 sMsg.appendAscii("\"" ); 555 } 556 sMsg.appendAscii("\tbut it was : " ); 557 sMsg.append (aURL.impldbg_toString()); 558 sMsg.appendAscii("\n" ); 559 } 560 561 WRITE_LOGFILE(LOGFILE_JOBURL, U2B(sMsg.makeStringAndClear())) 562 } 563 564 //________________________________ 565 /** 566 @short helper debug method 567 @descr It returns a representation of the internal object state 568 as string notation. 569 570 @returns The formated string representation. 571 */ 572 ::rtl::OUString JobURL::impldbg_toString() const 573 { 574 /* SAFE { */ 575 ReadGuard aReadLock(m_aLock); 576 577 ::rtl::OUStringBuffer sBuffer(256); 578 579 if (m_eRequest==E_UNKNOWN) 580 sBuffer.appendAscii("E_UNKNOWN"); 581 if ((m_eRequest & E_EVENT) == E_EVENT) 582 sBuffer.appendAscii("| E_EVENT"); 583 if ((m_eRequest & E_ALIAS) == E_ALIAS) 584 sBuffer.appendAscii("| E_ALIAS"); 585 if ((m_eRequest & E_SERVICE) == E_SERVICE) 586 sBuffer.appendAscii("| E_SERVICE"); 587 sBuffer.appendAscii("{ e=\"" ); 588 sBuffer.append (m_sEvent ); 589 sBuffer.appendAscii("\" - a=\""); 590 sBuffer.append (m_sAlias ); 591 sBuffer.appendAscii("\" - s=\""); 592 sBuffer.append (m_sService ); 593 sBuffer.appendAscii("\" }" ); 594 595 aReadLock.unlock(); 596 /* } SAFE */ 597 598 return sBuffer.makeStringAndClear(); 599 } 600 601 //________________________________ 602 603 sal_Bool JobURL::getServiceArgs( /*OUT*/ ::rtl::OUString& sServiceArgs ) const 604 { 605 /* SAFE { */ 606 ReadGuard aReadLock(m_aLock); 607 608 sServiceArgs = ::rtl::OUString(); 609 sal_Bool bSet = ((m_eRequest & E_SERVICE) == E_SERVICE); 610 if (bSet) 611 sServiceArgs = m_sServiceArgs; 612 613 aReadLock.unlock(); 614 /* } SAFE */ 615 616 return bSet; 617 } 618 619 //________________________________ 620 621 sal_Bool JobURL::getEventArgs( /*OUT*/ ::rtl::OUString& sEventArgs ) const 622 { 623 /* SAFE { */ 624 ReadGuard aReadLock(m_aLock); 625 626 sEventArgs = ::rtl::OUString(); 627 sal_Bool bSet = ((m_eRequest & E_EVENT) == E_EVENT); 628 if (bSet) 629 sEventArgs = m_sEventArgs; 630 631 aReadLock.unlock(); 632 /* } SAFE */ 633 634 return bSet; 635 } 636 637 //________________________________ 638 639 sal_Bool JobURL::getAliasArgs( /*OUT*/ ::rtl::OUString& sAliasArgs ) const 640 { 641 /* SAFE { */ 642 ReadGuard aReadLock(m_aLock); 643 644 sAliasArgs = ::rtl::OUString(); 645 sal_Bool bSet = ((m_eRequest & E_ALIAS) == E_ALIAS); 646 if (bSet) 647 sAliasArgs = m_sAliasArgs; 648 649 aReadLock.unlock(); 650 /* } SAFE */ 651 652 return bSet; 653 } 654 655 #endif // ENABLE_COMPONENT_SELF_CHECK 656 657 } // namespace framework 658